<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># cfs.1.3.1.patch
# upgrades to cfs.1.3.1 from cfs.1.3.0
# mab 10/27/95
diff -c ./Makefile ../cfs131/Makefile
*** ./Makefile	Fri Jul 28 03:21:32 1995
--- ../cfs131/Makefile	Fri Oct 27 13:40:57 1995
***************
*** 1,4 ****
! # Makefile for cfs 1.3.x, ESM 1.0
  #*
  #* The author of this software is Matt Blaze.
  #*              Copyright (c) 1992, 1993, 1994 by AT&amp;T.
--- 1,4 ----
! # Makefile for cfs 1.3.1, ESM 1.0
  #*
  #* The author of this software is Matt Blaze.
  #*              Copyright (c) 1992, 1993, 1994 by AT&amp;T.
***************
*** 41,53 ****
  
  # WARNING:  ESM RUNS ON FEWER PLATFORMS THAN CFS.  COMPILE ESM AT
  # YOUR OWN RISK IF YOU AREN'T USING BSDI OR SUNOS 4.x.
! # ESM does NOT run under Solaris.
  
  #CFS PORTS:
  # HP/UX, Irix, Linux and AIX ported by Mark Henderson (markh@wimsey.com)
  # Ultrix 4.2 ported by Ed Gould (ed@left.wing.org)
  # Solaris 2.3 ported by Mark Stein (Mark.Stein@Eng.Sun.COM)
  # More Solaris/Linux help by Christopher Oliver (oliver@fritz.co.traverse.com) 
  
  
  #==========================================================================
--- 41,54 ----
  
  # WARNING:  ESM RUNS ON FEWER PLATFORMS THAN CFS.  COMPILE ESM AT
  # YOUR OWN RISK IF YOU AREN'T USING BSDI OR SUNOS 4.x.
! # I think ESM now runs under Solaris, but test carefully.
  
  #CFS PORTS:
  # HP/UX, Irix, Linux and AIX ported by Mark Henderson (markh@wimsey.com)
  # Ultrix 4.2 ported by Ed Gould (ed@left.wing.org)
  # Solaris 2.3 ported by Mark Stein (Mark.Stein@Eng.Sun.COM)
  # More Solaris/Linux help by Christopher Oliver (oliver@fritz.co.traverse.com) 
+ #   and Greg Onufer &lt;Greg.Onufer@Eng.Sun.COM&gt;
  
  
  #==========================================================================
***************
*** 56,64 ****
  #
  # configuration options for all platforms
  #
! # pathnames, compiler, etc:
! CC=cc
! COPT=-O
  BINDIR=/usr/local/bin
  ETCDIR=/usr/local/etc
  PRINTCMD=enscript -Gr2
--- 57,73 ----
  #
  # configuration options for all platforms
  #
! # 1A, 1B: pathnames, compiler, etc:
! 
! #1A: compiler:
! # for cc, use
! #CC=cc
! #COPT=-O -DNOT_ANSI_C -DPROTOTYPES=0
! # for gcc, use
! CC=gcc
! COPT=-O2 -DPROTOTYPES=1
! 
! #1B: paths:
  BINDIR=/usr/local/bin
  ETCDIR=/usr/local/etc
  PRINTCMD=enscript -Gr2
***************
*** 68,78 ****
  
  # if you're a paranoid facist, you might want to configure
  # default timeouts on the attach command.  If you do,
! # just add definitions for TIMEOUT and IDLE with the default number
  # of minutes you want to the CFLAGS line.
! # So the CFLAGS line for the SUNOS configuration with a timeout
  # of 12 hours and an idle timer of 2 hours would look like:
! # CFLAGS=-O -DTIMEOUT=720 -DIDLE=120
  # If you leave them out the default timeouts are infinite.  You
  # can override them, of course, on the cattach command line.
  
--- 77,87 ----
  
  # if you're a paranoid facist, you might want to configure
  # default timeouts on the attach command.  If you do,
! # just add definitions for TMOUT and IDLE with the default number
  # of minutes you want to the CFLAGS line.
! # So the COPT line for the SUNOS CC configuration with a timeout
  # of 12 hours and an idle timer of 2 hours would look like:
! # COPT=-O -DTMOUT=720 -DIDLE=120
  # If you leave them out the default timeouts are infinite.  You
  # can override them, of course, on the cattach command line.
  
***************
*** 84,112 ****
  # You'll need to figure out how to install man pages yourself.
  
  ## use these for vanilla SUNOS 4.x
! #CFLAGS=$(COPT) -I$(RINCLUDES) -DPROTOTYPES=0 -DSUN
  #LIBS=
  #COMPAT=
  
  ## use these for Linux (Slackware 1.1.2)
  #CFLAGS=$(COPT) -I$(RINCLUDES)
  #LIBS=
  #COMPAT=
  
  ## Irix 4.0 -- markh@wimsey.bc.ca
! #CFLAGS=-cckr $(COPT) -Dirix
! #LIBS=-lrpcsvc -lsun -I$(RINCLUDES) -DPROTOTYPES=0
  #COMPAT=
  
  ## hpux 8.0 -- markh@wimsey.bc.ca
  # also thanks to Charles Henrich (henrich@crh.cl.msu.edu)
  # and Eric Ross (ericr@hpvclq.vcd.hp.com)
! #CFLAGS=$(COPT) -Dhpux -DNORLIMITS -I$(RINCLUDES) -DPROTOTYPES=0
  #LIBS=-lBSD
  #COMPAT=
  
  ## use these for AIX 3.2.0 -- markh@wimsey.bc.ca
! #CFLAGS=$(COPT) -D_BSD -D_SUN -DAIX320EUIDBUG -I$(RINCLUDES) -DPROTOTYPES=0
  #LIBS=
  #COMPAT=
  
--- 93,128 ----
  # You'll need to figure out how to install man pages yourself.
  
  ## use these for vanilla SUNOS 4.x
! #CFLAGS=$(COPT) -I$(RINCLUDES) -DSUN
  #LIBS=
  #COMPAT=
  
  ## use these for Linux (Slackware 1.1.2)
+ # NOTE TO LINUX USERS: You MUST make sure that you are using a version
+ # of RPCGEN that emits SunRPC compatible C code.  The version of rpcgen
+ # distributed with some versions of Linux will not work with CFS.  If CFS
+ # won't compile out of the box, this is the most likely problem.  Replace
+ # rpcgen, and things should work fine.
+ # See README.linux if you can't make things work.
  #CFLAGS=$(COPT) -I$(RINCLUDES)
  #LIBS=
  #COMPAT=
  
  ## Irix 4.0 -- markh@wimsey.bc.ca
! # see README.irix
! #CFLAGS=-cckr $(COPT) -Dirix -I$(RINCLUDES)
! #LIBS=-lrpcsvc -lsun
  #COMPAT=
  
  ## hpux 8.0 -- markh@wimsey.bc.ca
  # also thanks to Charles Henrich (henrich@crh.cl.msu.edu)
  # and Eric Ross (ericr@hpvclq.vcd.hp.com)
! #CFLAGS=$(COPT) -Dhpux -DNORLIMITS -I$(RINCLUDES)
  #LIBS=-lBSD
  #COMPAT=
  
  ## use these for AIX 3.2.0 -- markh@wimsey.bc.ca
! #CFLAGS=$(COPT) -D_BSD -D_SUN -DAIX320EUIDBUG -I$(RINCLUDES)
  #LIBS=
  #COMPAT=
  
***************
*** 138,144 ****
  #COMPAT=-lcompat
  
  ## use these flags on Solaris 2.3 / SUNOS 5.x
! #CFLAGS=$(COPT) -DSOLARIS2X -DPORTMAP -I$(RINCLUDES) -DPROTOTYPES=0
  #LIBS=-lsocket -lnsl
  #COMPAT=
  
--- 154,160 ----
  #COMPAT=-lcompat
  
  ## use these flags on Solaris 2.3 / SUNOS 5.x
! #CFLAGS=$(COPT) -DSOLARIS2X -DPORTMAP -I$(RINCLUDES) -DPTMX
  #LIBS=-lsocket -lnsl
  #COMPAT=
  
***************
*** 150,156 ****
  # (3/3) CONFIGURE: one last thing
  #==========================================================================
  # finally, comment out the next line:
! 	HEY! Edit the Makefile for your local configuration
  
  # now you're done with local configuration.
  
--- 166,172 ----
  # (3/3) CONFIGURE: one last thing
  #==========================================================================
  # finally, comment out the next line:
! CC=you_forgot_to_edit_the_makefile
  
  # now you're done with local configuration.
  
***************
*** 162,178 ****
  SRCS=Makefile admproto.x mount.x nfsproto.x cfs.c cfs_adm.c cfs_nfs.c cfs.h \
    cfs_fh.c cfs_des.c cfs_cipher.c mcg.c mcgsbox.c mcg.h shs.c shs.h cattach.c \
    getpass.c cdetach.c cmkdir.c adm.c cname.c ccat.c cpasswd.c truerand.c \
!   ver.c i o ssh
  ESRCS=esm.c esm_cipher.c esm_gen.c dhparams.c esm.h
  MANS=cattach.1 cdetach.1 cmkdir.1 ssh.1 cfsd.8 cname.8 ccat.8 cpasswd.1 \
!   README README.install README.history notes.ms README.linux README.esm esm.1
  OBJS= cfs.o nfsproto_xdr.o nfsproto_svr.o admproto_xdr.o admproto_svr.o \
    cfs_adm.o cfs_nfs.o cfs_fh.o cfs_des.o cfs_cipher.o adm.o ver.o mcgsbox.o \
!   mcg.o
  EOBJS=dhparams.o truerand.o esm_gen.o esm.o esm_cipher.o
  COBJS=admproto_clnt.o cfs_des.o cfs_cipher.o cattach.o getpass.o cmkdir.o \
    cdetach.o ver.o cname.o ccat.o mcgsbox.o mcgsbox.o mcg.o shs.o cpasswd.o \
!   truerand.o
  OTHERS = nfsproto.h nfsproto_svr.c nfsproto_xdr.c admproto.h admproto_svr.c \
    admproto_xdr.c admproto_clnt.c
  
--- 178,195 ----
  SRCS=Makefile admproto.x mount.x nfsproto.x cfs.c cfs_adm.c cfs_nfs.c cfs.h \
    cfs_fh.c cfs_des.c cfs_cipher.c mcg.c mcgsbox.c mcg.h shs.c shs.h cattach.c \
    getpass.c cdetach.c cmkdir.c adm.c cname.c ccat.c cpasswd.c truerand.c \
!   safer.c safer.h ver.c i o ssh
  ESRCS=esm.c esm_cipher.c esm_gen.c dhparams.c esm.h
  MANS=cattach.1 cdetach.1 cmkdir.1 ssh.1 cfsd.8 cname.8 ccat.8 cpasswd.1 \
!   README README.install README.history notes.ms README.linux README.irix \
!   README.esm esm.1
  OBJS= cfs.o nfsproto_xdr.o nfsproto_svr.o admproto_xdr.o admproto_svr.o \
    cfs_adm.o cfs_nfs.o cfs_fh.o cfs_des.o cfs_cipher.o adm.o ver.o mcgsbox.o \
!   mcg.o safer.o
  EOBJS=dhparams.o truerand.o esm_gen.o esm.o esm_cipher.o
  COBJS=admproto_clnt.o cfs_des.o cfs_cipher.o cattach.o getpass.o cmkdir.o \
    cdetach.o ver.o cname.o ccat.o mcgsbox.o mcgsbox.o mcg.o shs.o cpasswd.o \
!   truerand.o safer.o
  OTHERS = nfsproto.h nfsproto_svr.c nfsproto_xdr.c admproto.h admproto_svr.c \
    admproto_xdr.c admproto_clnt.c
  
***************
*** 186,223 ****
  	$(CC) $(OBJS) $(LIBS) -o cfsd
  
  cattach: cattach.o admproto_clnt.o admproto_xdr.o getpass.o cfs_des.o \
!   cfs_cipher.o adm.o ver.o mcg.o mcgsbox.o shs.o
  	$(CC) cattach.o admproto_clnt.o admproto_xdr.o cfs_des.o \
  	   cfs_cipher.o getpass.o adm.o ver.o mcg.o mcgsbox.o \
! 	   shs.o $(COMPAT) $(LIBS) -o cattach
  
  cdetach: cdetach.o admproto_clnt.o admproto_xdr.o adm.o ver.o
  	$(CC) cdetach.o adm.o admproto_clnt.o admproto_xdr.o \
  	   ver.o $(LIBS) -o cdetach
  
! cmkdir: getpass.o cfs_des.o cfs_cipher.o cmkdir.o ver.o mcg.o \
!    mcgsbox.o shs.o truerand.o
  	$(CC) cmkdir.o cfs_des.o cfs_cipher.o getpass.o adm.o ver.o mcg.o \
! 	   mcgsbox.o shs.o truerand.o  $(COMPAT) -o cmkdir
  
  cpasswd: getpass.o cfs_des.o cfs_cipher.o cpasswd.o ver.o mcg.o \
!    mcgsbox.o shs.o truerand.o
  	$(CC) cpasswd.o cfs_des.o cfs_cipher.o getpass.o ver.o mcg.o \
! 	   mcgsbox.o shs.o truerand.o  $(COMPAT) -o cpasswd
  
  cname: cname.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o \
!    cfs_nfs.o ver.o mcg.o mcgsbox.o shs.o
  	$(CC) cname.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o \
! 	   cfs_nfs.o ver.o mcg.o mcgsbox.o shs.o $(LIBS) $(COMPAT) -o cname
  
  ccat: ccat.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o cfs_nfs.o \
!    ver.o mcg.o mcgsbox.o shs.o
  	$(CC) ccat.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o \
! 	   cfs_nfs.o ver.o mcg.o mcgsbox.o shs.o $(LIBS) $(COMPAT) -o ccat
  
! $(OBJS): nfsproto.h admproto.h cfs.h mcg.h shs.h
  
! $(COBJS): nfsproto.h admproto.h cfs.h mcg.h shs.h
  
  nfsproto_xdr.c: nfsproto.x
  	rpcgen -c -o nfsproto_xdr.c nfsproto.x 
--- 203,242 ----
  	$(CC) $(OBJS) $(LIBS) -o cfsd
  
  cattach: cattach.o admproto_clnt.o admproto_xdr.o getpass.o cfs_des.o \
!   cfs_cipher.o adm.o ver.o mcg.o mcgsbox.o shs.o safer.o
  	$(CC) cattach.o admproto_clnt.o admproto_xdr.o cfs_des.o \
  	   cfs_cipher.o getpass.o adm.o ver.o mcg.o mcgsbox.o \
! 	   shs.o safer.o $(COMPAT) $(LIBS) -o cattach
  
  cdetach: cdetach.o admproto_clnt.o admproto_xdr.o adm.o ver.o
  	$(CC) cdetach.o adm.o admproto_clnt.o admproto_xdr.o \
  	   ver.o $(LIBS) -o cdetach
  
! cmkdir: getpass.o adm.o cfs_des.o cfs_cipher.o cmkdir.o ver.o mcg.o \
!    mcgsbox.o safer.o shs.o truerand.o
  	$(CC) cmkdir.o cfs_des.o cfs_cipher.o getpass.o adm.o ver.o mcg.o \
! 	   mcgsbox.o safer.o shs.o truerand.o  $(COMPAT) -o cmkdir
  
  cpasswd: getpass.o cfs_des.o cfs_cipher.o cpasswd.o ver.o mcg.o \
!    mcgsbox.o safer.o shs.o truerand.o
  	$(CC) cpasswd.o cfs_des.o cfs_cipher.o getpass.o ver.o mcg.o \
! 	   mcgsbox.o safer.o shs.o truerand.o  $(COMPAT) -o cpasswd
  
  cname: cname.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o \
!    cfs_nfs.o ver.o mcg.o mcgsbox.o safer.o shs.o
  	$(CC) cname.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o \
! 	   cfs_nfs.o ver.o mcg.o mcgsbox.o safer.o shs.o \
!            $(LIBS) $(COMPAT) -o cname
  
  ccat: ccat.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o cfs_nfs.o \
!    ver.o mcg.o mcgsbox.o shs.o safer.o
  	$(CC) ccat.o getpass.o cfs_des.o cfs_cipher.o cfs_adm.o cfs_fh.o \
! 	   cfs_nfs.o ver.o mcg.o mcgsbox.o shs.o safer.o \
!            $(LIBS) $(COMPAT) -o ccat
  
! $(OBJS): nfsproto.h admproto.h cfs.h mcg.h safer.h shs.h
  
! $(COBJS): nfsproto.h admproto.h cfs.h mcg.h safer.h shs.h
  
  nfsproto_xdr.c: nfsproto.x
  	rpcgen -c -o nfsproto_xdr.c nfsproto.x 
***************
*** 247,262 ****
  cfs.shar: $(SRCS) $(ESRCS) $(MANS)
  	shar $(SRCS) $(ESRCS) $(MANS)  &gt; cfs.shar
  
! printout: $(SRCS) cfs.h mcg.h admproto.h nfsproto.h
! 	$(PRINTCMD) $(SRCS) cfs.h mcg.h admproto.h nfsproto.h
! 
! labprint: $(SRCS) cfs.h mcg.h admproto.h nfsproto.h
! 	pr $(SRCS) cfs.h mcg.h admproto.h nfsproto.h | ipr -Pip7 -O -2 #-F
! 	stroff -man $(MANS)
  
  install_cfs: cfsd cattach cdetach cmkdir
  	install -m 0755 -c -o root cfsd $(ETCDIR)
! 	install -m 0755 -c -o root cattach cdetach cmkdir cpasswd ssh cname ccat $(BINDIR)
  #	install -m 0755 i o $(BINDIR)
  	@echo "Kill any running cfsd prior to restarting."
  	@echo "See the README file for more information."
--- 266,278 ----
  cfs.shar: $(SRCS) $(ESRCS) $(MANS)
  	shar $(SRCS) $(ESRCS) $(MANS)  &gt; cfs.shar
  
! printout: $(SRCS) cfs.h mcg.h safer.h admproto.h nfsproto.h
! 	$(PRINTCMD) $(SRCS) cfs.h mcg.h safer.h admproto.h nfsproto.h
  
  install_cfs: cfsd cattach cdetach cmkdir
  	install -m 0755 -c -o root cfsd $(ETCDIR)
! 	install -m 0755 -c -o root cattach cdetach cmkdir cpasswd ssh \
!                 cname ccat $(BINDIR)
  #	install -m 0755 i o $(BINDIR)
  	@echo "Kill any running cfsd prior to restarting."
  	@echo "See the README file for more information."
***************
*** 265,272 ****
  
  $(EOBJS): esm.h
  
! esm: esm.o cfs_des.o esm_cipher.o dhparams.o truerand.o
! 	$(CC) -o esm esm.o cfs_des.o esm_cipher.o dhparams.o truerand.o $(RSALIB)
  
  # to generate your own dhparams, remove the existing dhparams.c and
  # remake esm.  You shouldn't do this if you want to remain interoperable.
--- 281,288 ----
  
  $(EOBJS): esm.h
  
! esm: esm.o cfs_des.o esm_cipher.o dhparams.o truerand.o shs.o
! 	$(CC) -o esm esm.o cfs_des.o esm_cipher.o dhparams.o truerand.o shs.o $(RSALIB)
  
  # to generate your own dhparams, remove the existing dhparams.c and
  # remake esm.  You shouldn't do this if you want to remain interoperable.
***************
*** 283,286 ****
  
  esm.shar: 
  	shar README.esm Makefile esm.c *.x cfs_des.c esm_cipher.c esm_gen.c \
! 	dhparams.c truerand.c esm.h esm.1&gt; esm.shar
--- 299,302 ----
  
  esm.shar: 
  	shar README.esm Makefile esm.c *.x cfs_des.c esm_cipher.c esm_gen.c \
! 	     dhparams.c truerand.c shs.c esm.h esm.1&gt; esm.shar
diff -c ./README.history ../cfs131/README.history
*** ./README.history	Mon Jul 24 19:10:42 1995
--- ../cfs131/README.history	Thu Oct 26 15:17:09 1995
***************
*** 1,7 ****
  CFS revision history:
  
  1.3.0 - Some minor bug fixes.  Adds SHS-based key hash and indirect
! keys.  Includes ESM package.  Much left to do.
  
  1.2.1 - Fixes 3DES to make key caching work properly.  Fixed a few
  things to make porting easier.  Compatible with 1.2.0.
--- 1,13 ----
  CFS revision history:
  
+ 1.3.1 - Minor fixes (especially for Solaris).  Adds -p (puny memory)
+ support to cmkdir for people with puny machines.  Adds SAFER-SK128
+ cipher option.  Compatible with 1.3.0 (except, of course, for SAFER).
+ 
  1.3.0 - Some minor bug fixes.  Adds SHS-based key hash and indirect
! keys.  Includes ESM package.  Much left to do.  Compatible with
! previous versions; cmkdir -o creates directories backward compatible
! with 1.2.1.
  
  1.2.1 - Fixes 3DES to make key caching work properly.  Fixed a few
  things to make porting easier.  Compatible with 1.2.0.
diff -c ./README.install ../cfs131/README.install
*** ./README.install	Sun Jul 23 00:00:42 1995
--- ../cfs131/README.install	Fri Oct 27 13:05:08 1995
***************
*** 1,4 ****
! This is version 1.2.beta of CFS
  
   * The author of this software is Matt Blaze.
   *              Copyright (c) 1992, 1993, 1994, 1995 by AT&amp;T.
--- 1,4 ----
! This is version 1.3.1 of CFS
  
   * The author of this software is Matt Blaze.
   *              Copyright (c) 1992, 1993, 1994, 1995 by AT&amp;T.
***************
*** 53,59 ****
  
  6) mkdir /crypt (or whatever you want to call the cfs mount point)
  
! 7) add this to the end of /etc/rc.local:
  
  if [ -x /usr/local/etc/cfsd ]; then
  	/usr/local/etc/cfsd &amp;&amp; \
--- 53,60 ----
  
  6) mkdir /crypt (or whatever you want to call the cfs mount point)
  
! 7) add this to the end of /etc/rc.local (some place after you have
! mountd started):
  
  if [ -x /usr/local/etc/cfsd ]; then
  	/usr/local/etc/cfsd &amp;&amp; \
***************
*** 67,73 ****
        /etc/mount -o port=3049,intr,rsize=2048,wsize=2048 localhost:/null /crypt
  fi
  
- 
  8) run the commands in step 7 by hand to get it started now.  you may have to
  do an "exportfs -a" and/or /etc/rpc.mountd first if you aren't already running
  an NFS server, but this will be done automatically at boot time from now on.
--- 68,73 ----
***************
*** 75,80 ****
--- 75,88 ----
  9) if any of this fails, go back and read notes.ms.
  
  Notes:
+ 
+ Some systems (e.g., Solaris, Irix, etc.) don't use /etc/rc as the
+ startup file or have different options on some of the mount commands.
+ The basic idea, however, is the same: configure your system so that
+ when it boots it first starts mountd (with something exported to
+ localhost), then starts cfsd, and finally mounts cfsd at the /crypt
+ mountpoint.  See README.irix for step-by-step Irix instructions (which
+ may help with other SysV systems, too).
  
  If you already have cfs, this version may not be compatable with the
  encryption format used by your old copy.  If you have encrypted directories
diff -c ./README.irix ../cfs131/README.irix
*** ./README.irix	Fri Oct 27 13:16:34 1995
--- ../cfs131/README.irix	Thu Oct 26 15:18:09 1995
***************
*** 0 ****
--- 1,141 ----
+ From:     "Richard Moxley" &lt;mox@grunt.autometric.com&gt;
+ To:       Matt Blaze &lt;mab@research.att.com&gt;
+ Date:     Thu, 26 Oct 1995 13:33:15 -0400
+ Subject:  Irix 5.3 readme for CFS
+ Posted-Date: Thu, 26 Oct 1995 13:33:15 -0400
+ --
+ --PART-BOUNDARY=.19510261333.ZM1297.autometric.com
+ Content-Type: text/plain; charset=us-ascii
+ 
+ Matt:
+ 
+ Thanks for 1.3.0... it built on Irix without a problem using
+ the Irix 4.0 settings.
+ 
+ Attached is a README.irix that explains the modifications
+ that need to be made to the Makefile to build on Irix 5.3.
+ 
+ Also attached is cfs.rc.irix, which does the work that gets
+ done in rc.local on a Sun.  This file gets installed to
+ /etc/init.d and is linked from /etc/rc2.d and /etc/rc0.d.
+ All of this happens in the new install_cfs actions that I
+ describe in README.irix.  So, if you add README.irix to your
+ distribution, you should add cfs.rc.irix also.
+ 
+ Cheers,
+ R
+ 
+ -- 
+ +----------------------------------------------------------------------------+
+ | Richard Moxley                                  Frustra fit per plura quod |
+ | rmoxley@autometric.com                          potest fieri per pauciora. |
+ +----------------------------------------------------------------------------+
+ 
+ --PART-BOUNDARY=.19510261333.ZM1297.autometric.com
+ X-Zm-Content-Name: README.irix
+ Content-Description: Text
+ Content-Type: text/plain ; name="README.irix" ; charset=us-ascii
+ 
+ CFS 1.3.0 under Irix 5.3
+ ------------------------
+ 
+ Compiling:
+ 
+ 1.  Edit the Makefile to use the makeflags for Irix 4.0 
+ 
+     CFLAGS=-cckr $(COPT) -Dirix
+     LIBS=-lrpcsvc -lsun -I$(RINCLUDES) -DPROTOTYPES=0
+     COMPAT=
+ 
+     Also, change the install_cfs actions to the following:
+ 
+     install -m 0755 -u root -f $(ETCDIR) cfsd
+     install -m 0755 -u root -f $(BINDIR) cattach cdetach \
+            cmkdir cpasswd ssh cname ccat i o
+     install -m 0755 -u root -f /etc/init.d cfs.rc.irix
+     ln -s /etc/init.d/cfs.rc.irix /etc/rc2.d/S35cfs
+     ln -s /etc/init.d/cfs.rc.irix /etc/rc0.d/K35cfs
+ 
+ 3.  Type "make cfs"
+ 
+ 
+ Installing:
+ 
+ 1.  Become root and type "make install_cfs".
+ 
+ 2.  Create the cfs bootstrap mount point:
+ 
+     mkdir /null
+     chmod 0 /null
+ 
+ 3.  Add this line to /etc/exports:
+ 
+ /null localhost
+ 
+ 4.  Create the mount point
+ 
+     mkdir /crypt  (or whatever you want to call it)
+ 
+ 5.  Reboot
+ 
+ 
+ --
+ Richard Moxley    rmoxley@autometric.com
+ 
+ --PART-BOUNDARY=.19510261333.ZM1297.autometric.com
+ X-Zm-Content-Name: cfs.rc.irix
+ Content-Description: Text
+ Content-Type: text/plain ; name="cfs.rc.irix" ; charset=us-ascii
+ 
+ #!/sbin/sh
+ 
+ # CFS boot script for Irix 5.3
+ # Richard Moxley  rmoxley@autometric.com
+ 
+ MOUNT=/sbin/mount
+ CFSD=/usr/local/etc/cfsd
+ CFS_NULLDIR=/null
+ CFS_MOUNTPT=/crypt
+ 
+ case "$1" in
+ 'start')
+ 
+     if test -x $CFSD; then
+         echo "Starting CFS... \c"
+         if test ! -d $CFS_NULLDIR; then
+             mkdir $CFS_NULLDIR
+         fi
+         cd $CFS_NULLDIR
+         chown root .
+         chgrp sys .
+         chmod 0 .
+         if test ! -d $CFS_MOUNTPT; then
+             mkdir $CFS_MOUNTPT
+         fi
+         cd $CFS_MOUNTPT
+         chown root .
+         chown sys .
+         chmod 755 .
+         
+         $CFSD
+         sleep 1
+         $MOUNT -o port=3049,intr localhost:$CFS_NULLDIR $CFS_MOUNTPT
+     else
+         echo "CFS not found."
+     fi
+     ;;
+ 
+ 
+ 'stop')
+ 
+     /sbin/killall cfsd
+     ;;
+ 
+ 
+ *)
+     echo "usage: $0 {start|stop}"
+     ;;
+ esac
+ 
+ --PART-BOUNDARY=.19510261333.ZM1297.autometric.com--
+ 
diff -c ./admproto.x ../cfs131/admproto.x
*** ./admproto.x	Sat Jul 22 23:28:32 1995
--- ../cfs131/admproto.x	Thu Oct 26 18:12:57 1995
***************
*** 24,30 ****
  
  /*
   * cfs admin protocol RPC spec
!  *  1.3 version, supporting multiple crypt modes &amp; new ciphers
   */
  
  /* error conditions */
--- 24,30 ----
  
  /*
   * cfs admin protocol RPC spec
!  *  1.3.1 version, supporting multiple crypt modes &amp; new ciphers, plus sflg
   */
  
  /* error conditions */
***************
*** 45,51 ****
  	CFS_IDEA=2,		/* 2 key hybrid IDEA (n/a) */
  	CFS_BLOWFISH=3,		/* 2 key hybrid BLOWFISH */
  	CFS_SKIPJACK=4,		/* 2 key hybrid SKIPJACK, (PCMCIA) (n/a) */
! 	CFS_MACGUFFIN=5		/* 2 key hybrid MacGuffin */
  };
  
  const CFS_MAXCOMP=255;
--- 45,52 ----
  	CFS_IDEA=2,		/* 2 key hybrid IDEA (n/a) */
  	CFS_BLOWFISH=3,		/* 2 key hybrid BLOWFISH */
  	CFS_SKIPJACK=4,		/* 2 key hybrid SKIPJACK, (PCMCIA) (n/a) */
! 	CFS_MACGUFFIN=5,	/* 1 key hybrid MacGuffin */
! 	CFS_SAFER_SK128=6	/* 1 key hybrid SAFER-SK128 */
  };
  
  const CFS_MAXCOMP=255;
***************
*** 79,84 ****
--- 80,92 ----
  	u_char secondary[16];	/* same as primary */
  };
  
+ 
+ struct cfs_adm_saferkey {
+ 	long pl;		/* for 32 bit align police */
+ 	u_char primary[16];
+ 	u_char secondary[16];	/* same as primary */
+ };
+ 
  union cfs_admkey switch (ciphers cipher) {
      case CFS_STD_DES:
  	cfs_adm_deskey deskey;
***************
*** 88,93 ****
--- 96,103 ----
  	cfs_adm_blowkey blowkey;
      case CFS_MACGUFFIN:
  	cfs_adm_mcgkey mcgkey;
+     case CFS_SAFER_SK128:
+ 	cfs_adm_saferkey saferkey;
      default:
  	void;
  };
***************
*** 103,108 ****
--- 113,119 ----
  	/* for timeouts, zero indicates infinite */
  	int expire;			/* number of minutes to live */
  	int idle;			/* idle timeout */
+ 	int smsize;			/* use small memeory option */
  };
  
  struct cfs_detachargs {
***************
*** 117,123 ****
  		cfsstat ADMPROC_ATTACH(cfs_attachargs) = 1;
  		cfsstat ADMPROC_DETACH(cfs_detachargs) = 2;
  	} = 2;
! } = 0x21234567;
  
  
  
--- 128,134 ----
  		cfsstat ADMPROC_ATTACH(cfs_attachargs) = 1;
  		cfsstat ADMPROC_DETACH(cfs_detachargs) = 2;
  	} = 2;
! } = 0x31234567;
  
  
  
diff -c ./cattach.c ../cfs131/cattach.c
*** ./cattach.c	Mon Jul 24 17:07:36 1995
--- ../cfs131/cattach.c	Thu Oct 26 15:17:01 1995
***************
*** 23,29 ****
   */
  
  /*
!  * client side attach - 1.3
   */
  #include &lt;stdio.h&gt;
  #include &lt;rpc/rpc.h&gt;
--- 23,29 ----
   */
  
  /*
!  * client side attach - 1.3.1
   */
  #include &lt;stdio.h&gt;
  #include &lt;rpc/rpc.h&gt;
***************
*** 56,63 ****
  #define getwd(b)	getcwd(b, 1024)
  #endif
  
! #ifndef TIMEOUT		/* default timeout; override in makefile */
! #define TIMEOUT 0
  #endif
  
  #ifndef IDLE		/* default idle timer; override in makefile */
--- 56,63 ----
  #define getwd(b)	getcwd(b, 1024)
  #endif
  
! #ifndef TMOUT		/* default timeout; override in makefile */
! #define TMOUT 0
  #endif
  
  #ifndef IDLE		/* default idle timer; override in makefile */
***************
*** 87,96 ****
  	unsigned char ekey[128];
  	char cname[1024];
  	char kname[1024]; /* indirect key file */
  	int cfmt=0;
  	static struct timeval tout = {60,0};
  	CLIENT *cln;
! 	int timeout=TIMEOUT;
  	int idle=IDLE;
  	char *dirarg=NULL;
  	char *namearg=NULL;
--- 87,98 ----
  	unsigned char ekey[128];
  	char cname[1024];
  	char kname[1024]; /* indirect key file */
+ 	char sname[1024];
+ 	int smsize;
  	int cfmt=0;
  	static struct timeval tout = {60,0};
  	CLIENT *cln;
! 	int timeout=TMOUT;
  	int idle=IDLE;
  	char *dirarg=NULL;
  	char *namearg=NULL;
***************
*** 171,176 ****
--- 173,179 ----
  	}
  	sprintf(cname,"%s/..c",dir);
  	sprintf(kname,"%s/..k",dir);
+ 	sprintf(sname,"%s/..s",dir);
  	if ((fp=fopen(cname,"r")) == NULL) {
  		ciph=CFS_STD_DES;
  	} else {
***************
*** 185,193 ****
--- 188,209 ----
  			cfmt=0;
  		fclose(fp);
  	}
+ 	if ((fp=fopen(sname,"r")) == NULL) {
+ 		smsize=LARGESMSIZE;
+ 	} else {
+ 		if (fscanf(fp,"%d",&amp;smsize) != 1)
+ 			smsize=LARGESMSIZE;
+ 		fclose(fp);
+ 		if ((smsize &lt; CFSBLOCK) || (smsize &gt; (LARGESMSIZE*2)))
+ 			smsize=LARGESMSIZE;
+ 	}
+ 	ap.smsize = smsize;
  	ap.idle = idle;
  	ap.expire = timeout;
  	ap.key.cipher=ciph;
+ 	if (smsize != LARGESMSIZE)
+ 		sprintf(pw,"%s%d",pw,smsize);
+ 
  	if (cfmt) {
  		if (new_pwcrunch(pw,&amp;ap.key)!=0) {
  			fprintf(stderr,"Invalid key\n");
diff -c ./ccat.8 ../cfs131/ccat.8
*** ./ccat.8	Sat Jul 22 23:14:41 1995
--- ../cfs131/ccat.8	Fri Oct 27 12:51:08 1995
***************
*** 3,9 ****
  ccat
  .SH SYNOPSIS
  .B ccat
! [ \-\fB3m\fP ]
  \fIfile\fP
  [ ... ]
  .SH DESCRIPTION
--- 3,9 ----
  ccat
  .SH SYNOPSIS
  .B ccat
! [ \-\fB3ms\fP ]
  \fIfile\fP
  [ ... ]
  .SH DESCRIPTION
***************
*** 12,19 ****
  file (.pvect_*) file exists in the same directory, it is used to
  perturb the file accordingly.  By default, files are decrypted using
  standard 2-key hybrid mode single-DES.  The \-\fB3\fP option specifies
! 2-key hybrid mode triple DES.  The \-\fBm\fP option specifies 2-key
! hybrid mode MacGuffin.
  .LP
  \fBccat\fP is intended to assist in emergency access to CFS
  directories when no machine running a CFS daemon is available.  It is
--- 12,19 ----
  file (.pvect_*) file exists in the same directory, it is used to
  perturb the file accordingly.  By default, files are decrypted using
  standard 2-key hybrid mode single-DES.  The \-\fB3\fP option specifies
! 2-key hybrid mode triple DES.  The \-\fBm\fP option specifies 1-key
! hybrid mode MacGuffin, and \-\fBs\fP specifies SAFER-SK128.
  .LP
  \fBccat\fP is intended to assist in emergency access to CFS
  directories when no machine running a CFS daemon is available.  It is
diff -c ./ccat.c ../cfs131/ccat.c
*** ./ccat.c	Sat Jul 22 23:06:37 1995
--- ../cfs131/ccat.c	Fri Oct 27 12:46:03 1995
***************
*** 74,89 ****
  			    case '3':
  				ciph=CFS_THREE_DES;
  				break;
  			    case 'm':
  				ciph=CFS_MACGUFFIN;
  				break;
  			    default:
! 				fprintf(stderr,"usage: ccat [-3m] file ...\n");
  				exit(1);
  			}
  	}
  	if (argc&lt;1) {
! 		fprintf(stderr,"Usage: ccat [-3m] file ...\n");
  		exit(1);
  	}
  	if ((pw=getpassword("Key:"))==NULL) {
--- 74,97 ----
  			    case '3':
  				ciph=CFS_THREE_DES;
  				break;
+ #ifdef NOTDEF				
+ 			    case 'b':
+ 				ciph=CFS_BLOWFISH;
+ 				break;
+ #endif				
  			    case 'm':
  				ciph=CFS_MACGUFFIN;
  				break;
+ 			    case 's':
+ 				ciph=CFS_SAFER_SK128;
+ 				break;
  			    default:
! 				fprintf(stderr,"usage: ccat [-3bms] file...\n");
  				exit(1);
  			}
  	}
  	if (argc&lt;1) {
! 		fprintf(stderr,"Usage: ccat [-3bms] file...\n");
  		exit(1);
  	}
  	if ((pw=getpassword("Key:"))==NULL) {
diff -c ./cfs.h ../cfs131/cfs.h
*** ./cfs.h	Sat Jul 22 19:56:33 1995
--- ../cfs131/cfs.h	Fri Oct 27 12:47:59 1995
***************
*** 25,30 ****
--- 25,31 ----
  /* include files specific to cipher modules go here */
  /* (i don't normally like nested includes) */
  #include "mcg.h"
+ #include "safer.h"
  
  #define H_REG 0
  #define H_ATTACH 0	/* same as regular */
***************
*** 52,58 ****
  #define IDEA 2		/* 2 key hybrid IDEA (n/a) */
  #define BLOWFISH 3	/* 2 key hybrid BLOWFISH (n/a) */
  #define SKIPJACK 4	/* 2 key hybrid SKIPJACK (PCMCIA) (n/a) */
! #define MCG 5		/* 2 key hybrid MacGuffin */
  
  typedef struct fhdata {
  	u_char magic[8];/* 0x0123456789abcdef */
--- 53,60 ----
  #define IDEA 2		/* 2 key hybrid IDEA (n/a) */
  #define BLOWFISH 3	/* 2 key hybrid BLOWFISH (n/a) */
  #define SKIPJACK 4	/* 2 key hybrid SKIPJACK (PCMCIA) (n/a) */
! #define MCG 5		/* 1 key hybrid MacGuffin */
! #define SAFER_SK128 6	/* 1 key hybrid SAFER-SK128 */
  
  typedef struct fhdata {
  	u_char magic[8];/* 0x0123456789abcdef */
***************
*** 103,109 ****
  #define HSIZE 1024
  #define HMASK 0x3ff	/* change these together, please */
  
! #define SMSIZE (32768*CFSBLOCK)
  
  typedef struct cfskey {  /* now holds expanded keys for DES also */
  	int cipher;
--- 105,112 ----
  #define HSIZE 1024
  #define HMASK 0x3ff	/* change these together, please */
  
! #define LARGESMSIZE (32768*CFSBLOCK)
! #define SMALLSMSIZE (512*CFSBLOCK)
  
  typedef struct cfskey {  /* now holds expanded keys for DES also */
  	int cipher;
***************
*** 122,130 ****
  			mcg_key primary;
  			mcg_key secondary;
  		} mcg;
  	} var;
! 	char primask[SMSIZE];
! 	char secmask[SMSIZE];
  } cfskey;
  
  typedef struct instance {
--- 125,144 ----
  			mcg_key primary;
  			mcg_key secondary;
  		} mcg;
+ #ifdef NOTDEF		
+ 		struct { /* Blowfish */
+ 			bfkey primary;
+ 			bfkey secondary;
+ 		} bf;
+ #endif
+ 		struct { /* SAFER */
+ 			safer_key_t primary;
+ 			safer_key_t secondary;
+ 		} safer;
  	} var;
! 	int smsize; /* right now either LARGESMSIZE or SMALLSMSIZE */
! 	char *primask;
! 	char *secmask;
  } cfskey;
  
  typedef struct instance {
diff -c ./cfs_adm.c ../cfs131/cfs_adm.c
*** ./cfs_adm.c	Mon Jul 24 15:58:33 1995
--- ../cfs131/cfs_adm.c	Thu Oct 26 15:17:58 1995
***************
*** 23,29 ****
   */
  
  /*
!  * server adm rpc handlers - ver 1.2
   */
  #include &lt;sys/types.h&gt;
  #include &lt;stdio.h&gt;
--- 23,29 ----
   */
  
  /*
!  * server adm rpc handlers - ver 1.3.1
   */
  #include &lt;sys/types.h&gt;
  #include &lt;stdio.h&gt;
***************
*** 98,103 ****
--- 98,115 ----
  	ins-&gt;id=i;
  	for (i=0; i&lt;HSIZE; i++)
  		ins-&gt;file[i]=NULL;
+ 	ins-&gt;key.smsize = ap-&gt;smsize;
+ 	if ((ins-&gt;key.primask=(char*) malloc(ins-&gt;key.smsize)) == NULL) {
+ 		free(ins);
+ 		ret = CFSERR_IFULL;
+ 		return &amp;ret;
+ 	}
+ 	if ((ins-&gt;key.secmask=(char*) malloc(ins-&gt;key.smsize)) == NULL) {
+ 		free(ins-&gt;key.primask);
+ 		free(ins);
+ 		ret = CFSERR_IFULL;
+ 		return &amp;ret;
+ 	}
  	ins-&gt;anon=ap-&gt;anon;
  	sprintf(ins-&gt;path,"%s/.",ap-&gt;dirname);
  	strcpy(ins-&gt;name,ap-&gt;name);
***************
*** 138,144 ****
  	char start[9];
  	FILE *fp;
  
! 	for (i=0; i&lt;SMSIZE; i+=CFSBLOCK) {
  		sprintf(start,"0%07x",i/CFSBLOCK);
  		bcopy(start,&amp;k-&gt;primask[i],CFSBLOCK);
  		mask_cipher(k,&amp;k-&gt;primask[i],0);
--- 150,156 ----
  	char start[9];
  	FILE *fp;
  
! 	for (i=0; i &lt; k-&gt;smsize; i+=CFSBLOCK) {
  		sprintf(start,"0%07x",i/CFSBLOCK);
  		bcopy(start,&amp;k-&gt;primask[i],CFSBLOCK);
  		mask_cipher(k,&amp;k-&gt;primask[i],0);
***************
*** 184,189 ****
--- 196,205 ----
  		freelist(instances[i]-&gt;file[j]);
  		instances[i]-&gt;file[j]=NULL;
  	}
+ 	bzero((char *)instances[i]-&gt;key.primask,instances[i]-&gt;key.smsize);
+ 	free(instances[i]-&gt;key.primask);
+ 	bzero((char *)instances[i]-&gt;key.secmask,instances[i]-&gt;key.smsize);
+ 	free(instances[i]-&gt;key.secmask);
  	bzero((char *)instances[i],sizeof(instance));
  	free(instances[i]);
  	instances[i]=NULL;
diff -c ./cfs_cipher.c ../cfs131/cfs_cipher.c
*** ./cfs_cipher.c	Sat Jul 22 20:22:34 1995
--- ../cfs131/cfs_cipher.c	Fri Oct 27 12:43:00 1995
***************
*** 50,55 ****
--- 50,68 ----
  		else
  			mcg_block_encrypt(s,&amp;k-&gt;var.mcg.primary);
  		break;
+ #ifdef NOTDEF		
+ 	    case BLOWFISH:
+ 		if (d)
+ 			Blowfish_decipher(s,&amp;k-&gt;var.bf.primary);
+ 		else
+ 			Blowfish_encipher(s,&amp;k-&gt;var.bf.primary);
+ 		break;
+ #endif		
+ 	    case SAFER_SK128:
+ 		if (d)
+ 			Safer_Decrypt_Block(s,k-&gt;var.safer.primary,s);
+ 		else
+ 			Safer_Encrypt_Block(s,k-&gt;var.safer.primary,s);
  	    default:	/* just does nothing */
  		break;
  	}
***************
*** 76,81 ****
--- 89,107 ----
  		else
  			mcg_block_encrypt(s,&amp;k-&gt;var.mcg.secondary);
  		break;
+ #ifdef NOTDEF		
+ 	    case BLOWFISH:
+ 		if (d)
+ 			Blowfish_decipher(s,&amp;k-&gt;var.bf.secondary);
+ 		else
+ 			Blowfish_encipher(s,&amp;k-&gt;var.bf.secondary);
+ 		break;
+ #endif		
+ 	    case SAFER_SK128:
+ 		if (d)
+ 			Safer_Decrypt_Block(s,k-&gt;var.safer.secondary,s);
+ 		else
+ 			Safer_Encrypt_Block(s,k-&gt;var.safer.secondary,s);
  	    default:	/* just does nothing */
  		break;
  	}
***************
*** 113,118 ****
--- 139,166 ----
  		mcg_keyset(key-&gt;cfs_admkey_u.mcgkey.secondary,
  			   &amp;k-&gt;var.mcg.secondary);
  		break;
+ #ifdef NOTDEF		
+ 	    case CFS_BLOWFISH:
+ 		k-&gt;cipher=BLOWFISH;
+ 		Blowfish_Initialize(key-&gt;cfs_admkey_u.blowkey.primary,16,
+ 				    &amp;k-&gt;var.bf.primary);
+ 		Blowfish_Initialize(key-&gt;cfs_admkey_u.blowkey.secondary,16,
+ 				    &amp;k-&gt;var.bf.secondary);
+ 		break;
+ #endif		
+ 	    case CFS_SAFER_SK128:
+ 		k-&gt;cipher=SAFER_SK128;
+ 		Safer_Init_Module();
+ 		Safer_Expand_Userkey(key-&gt;cfs_admkey_u.saferkey.primary,
+ 				     &amp;(key-&gt;cfs_admkey_u.saferkey.primary[8]),
+ 				     SAFER_SK128_DEFAULT_NOF_ROUNDS,
+ 				     1, /* for SK128 */
+ 				     k-&gt;var.safer.primary);
+ 		Safer_Expand_Userkey(key-&gt;cfs_admkey_u.saferkey.secondary,
+ 				     &amp;(key-&gt;cfs_admkey_u.saferkey.secondary[8]),
+ 				     SAFER_SK128_DEFAULT_NOF_ROUNDS,
+ 				     1, /* for SK128 */
+ 				     k-&gt;var.safer.secondary);
  	    default:
  		break;
  	}
diff -c ./cfs_fh.c ../cfs131/cfs_fh.c
*** ./cfs_fh.c	Mon Jul 24 16:15:34 1995
--- ../cfs131/cfs_fh.c	Thu Oct 26 15:17:59 1995
***************
*** 299,315 ****
       int salt;
       char *vect;
  {
! 	int i,j;
  	
  	for (i=0; i&lt;l; i+=8) {
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;primask[(i+j+salt)%SMSIZE]
  				^ vect[j]
! 				^ (((i+j+salt)/SMSIZE)&amp;0377);
  				/* makes big offsets have different masks */
  		cipher(k,&amp;s[i],0);
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;secmask[(i+j+salt)%SMSIZE];
  	}
  }
  
--- 299,316 ----
       int salt;
       char *vect;
  {
! 	int i,j,smsize;
  	
+ 	smsize=k-&gt;smsize;
  	for (i=0; i&lt;l; i+=8) {
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;primask[(i+j+salt)%smsize]
  				^ vect[j]
! 				^ (((i+j+salt)/smsize)&amp;0377);
  				/* makes big offsets have different masks */
  		cipher(k,&amp;s[i],0);
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;secmask[(i+j+salt)%smsize];
  	}
  }
  
***************
*** 320,335 ****
       int salt;
       char *vect;
  {
! 	int i,j;
  	
  	for (i=0; i&lt;l; i+=8) {
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;secmask[(i+j+salt)%SMSIZE];
  		cipher(k,&amp;s[i],1);
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;primask[(i+j+salt)%SMSIZE]
  				^ vect[j]
! 				^ (((i+j+salt)/SMSIZE) &amp; 0377);
  	}
  		
  }
--- 321,337 ----
       int salt;
       char *vect;
  {
! 	int i,j,smsize;
  	
+ 	smsize=k-&gt;smsize;
  	for (i=0; i&lt;l; i+=8) {
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;secmask[(i+j+salt)%smsize];
  		cipher(k,&amp;s[i],1);
  		for (j=0; j&lt;8; j++)
! 			s[i+j] ^= k-&gt;primask[(i+j+salt)%smsize]
  				^ vect[j]
! 				^ (((i+j+salt)/smsize) &amp; 0377);
  	}
  		
  }
***************
*** 547,554 ****
  		close(curfd);	/* hope it was valid... */
  		openfd=NULL;
  	}
  	if (mode==0) { mode=CFS_WRITE; }
! 	if ((fd=open(f-&gt;name,mode,0))&lt;0) {
  		cfserrno=cfsno(errno);
  		if ((errno == EACCES) &amp;&amp; (mode==CFS_WRITE)) { /* ugly hack */
  			int omode;
--- 549,563 ----
  		close(curfd);	/* hope it was valid... */
  		openfd=NULL;
  	}
+ 
  	if (mode==0) { mode=CFS_WRITE; }
! 	/* Phil Karn's hack for R/O file systems */
! 	if ((fd=open(f-&gt;name,mode,0))&lt;0 &amp;&amp; errno == EROFS) {
! 		mode = CFS_READ;        /* Force read and try again */
! 		fd = open(f-&gt;name,mode,0);
! 	}
! 
! 	if(fd&lt;0) {
  		cfserrno=cfsno(errno);
  		if ((errno == EACCES) &amp;&amp; (mode==CFS_WRITE)) { /* ugly hack */
  			int omode;
diff -c ./cmkdir.1 ../cfs131/cmkdir.1
*** ./cmkdir.1	Sat Jul 22 23:12:41 1995
--- ../cfs131/cmkdir.1	Fri Oct 27 12:51:07 1995
***************
*** 3,9 ****
  cmkdir - create encrypted directory for CFS
  .SH SYNOPSIS
  .B cmkdir
! [ \-\fB3mo\fP ]
  \fIdirectory\fP
  .SH DESCRIPTION
  \fBcmkdir\fP creates \fIdirectory\fP and assigns to it cryptographic
--- 3,9 ----
  cmkdir - create encrypted directory for CFS
  .SH SYNOPSIS
  .B cmkdir
! [ \-\fB3bmost\fP ]
  \fIdirectory\fP
  .SH DESCRIPTION
  \fBcmkdir\fP creates \fIdirectory\fP and assigns to it cryptographic
***************
*** 32,42 ****
  .B ccat
  as well.
  .LP
! A new experimental block cipher is included in the default
  distribution.  The \-\fBm\fP option specifies Blaze and Schneier's
  "MacGuffin" cipher.  It has 32 rounds, a 64 bit codebook size and a
  128 bit nominal keyspace.  Use this cipher at your own risk; it may be
  much weaker than its keyspace suggests.
  .SH FILES
  .TP
  \fIdirectory\fP/...
--- 32,53 ----
  .B ccat
  as well.
  .LP
! The -p ("puny") option creates directories that use much less memory
! when attached under cfsd.  This is useful on machines with very little
! (less than, say, 8MBs with a window system and browser also running)
! memory.  Files in directories created under -p may reveal slightly
! more about their structure than regular CFS files.
! .LP
! Two new experimental block ciphers are included in the default
  distribution.  The \-\fBm\fP option specifies Blaze and Schneier's
  "MacGuffin" cipher.  It has 32 rounds, a 64 bit codebook size and a
  128 bit nominal keyspace.  Use this cipher at your own risk; it may be
  much weaker than its keyspace suggests.
+ .LP
+ Another new cipher, James Massey's SAFER-SK128, is also available in
+ this release.  Specify SAFER-SK128 with the \-\fBs\fP option.  Again,
+ this cipher hasn't been around nearly as long as DES, so use it at
+ your own risk.  SAFER is a little faster than triple DES.
  .SH FILES
  .TP
  \fIdirectory\fP/...
***************
*** 47,54 ****
  .SH SEE ALSO
  cfsd(8), cattach(1)
  .SH BUGS
! The MacGuffin cipher isn't nearly as well-studied as DES.  It is
! included primarly as an example.  The author's personal files remain
! protected with DES.
  .SH AUTHOR
  Matt Blaze; for information on cfs, email to cfs@research.att.com.
--- 58,66 ----
  .SH SEE ALSO
  cfsd(8), cattach(1)
  .SH BUGS
! The MacGuffin, Blowfish and SAFER ciphers aren't nearly as
! well-studied as DES.  They are included primarly as an example of how
! to add ciphers to CFS.  The author's personal files remain protected
! with DES.
  .SH AUTHOR
  Matt Blaze; for information on cfs, email to cfs@research.att.com.
diff -c ./cmkdir.c ../cfs131/cmkdir.c
*** ./cmkdir.c	Sat Jul 22 23:08:37 1995
--- ../cfs131/cmkdir.c	Fri Oct 27 13:09:02 1995
***************
*** 23,29 ****
   */
  
  /*
!  * client cfs mkdir - 1.3
   */
  #include &lt;stdio.h&gt;
  #include &lt;rpc/rpc.h&gt;
--- 23,29 ----
   */
  
  /*
!  * client cfs mkdir - 1.3.1
   */
  #include &lt;stdio.h&gt;
  #include &lt;rpc/rpc.h&gt;
***************
*** 51,56 ****
--- 51,57 ----
  	int i;
  	int ciph=CFS_STD_DES;
  	int cfmt=1;
+ 	int smsize=LARGESMSIZE;
  	unsigned char ekey[128];
  	unsigned char ek1[128];
  	unsigned int l;
***************
*** 61,78 ****
  			    case '3':
  				ciph=CFS_THREE_DES;
  				break;
  			    case 'm':
  				ciph=CFS_MACGUFFIN;
  				break;
  			    case 'o':
  				cfmt=0;
  				break;
  			    default:
! 				fprintf(stderr,"usage: cmkdir [-3m] dir\n");                               exit(1);
  			}
  	}
  	if (argc!=1) {
! 		fprintf(stderr,"Usage: cmkdir [-3m] dir\n");
  		exit(1);
  	}
  	if ((pw=getpassword("Key:"))==NULL) {
--- 62,91 ----
  			    case '3':
  				ciph=CFS_THREE_DES;
  				break;
+ #ifdef NOTDEF
+ 			    case 'b':
+ 				ciph=CFS_BLOWFISH;
+ 				break;
+ #endif				
  			    case 'm':
  				ciph=CFS_MACGUFFIN;
  				break;
+ 			    case 's':
+ 				ciph=CFS_SAFER_SK128;
+ 				break;
  			    case 'o':
  				cfmt=0;
  				break;
+ 			    case 'p':	/* puny memory option */
+ 				smsize=SMALLSMSIZE;
+ 				break;
  			    default:
! 				fprintf(stderr,"usage: cmkdir [-3bmosp] dir\n");
! 				exit(1);
  			}
  	}
  	if (argc!=1) {
! 		fprintf(stderr,"Usage: cmkdir [-3bmost] dir\n");
  		exit(1);
  	}
  	if ((pw=getpassword("Key:"))==NULL) {
***************
*** 93,98 ****
--- 106,113 ----
  			"Keys don't match; drink some coffee and try again\n");
  		exit(1);
  	}
+ 	if (smsize != LARGESMSIZE)
+ 		sprintf(pw,"%s%d",pword,smsize);
  	k.cipher=ciph;
  	if (cfmt==0) { 
  		if (old_pwcrunch(pw,&amp;k)!=0) {
***************
*** 108,115 ****
  		/* now we xor in some truerand bytes for good measure */
  		bcopy(&amp;k,ekey,32);  /* assumes key material &lt; 32 bytes */
  		for (i=0; i&lt;32; i++) {
! 			l=truerand(); 
! 			ekey[i] ^= (shs(&amp;l,sizeof(l)))[0];
  		}
  		encrypt_key(&amp;k,ekey);
  		bcopy(ekey,ek1,32);
--- 123,129 ----
  		/* now we xor in some truerand bytes for good measure */
  		bcopy(&amp;k,ekey,32);  /* assumes key material &lt; 32 bytes */
  		for (i=0; i&lt;32; i++) {
! 			ekey[i] ^= randbyte(); 
  		}
  		encrypt_key(&amp;k,ekey);
  		bcopy(ekey,ek1,32);
***************
*** 143,148 ****
--- 157,169 ----
  		exit(1);
  	}
  	fprintf(fp,"%d",k.cipher);
+ 	fclose(fp);
+ 	sprintf(path,"%s/..s",argv[0]);
+ 	if ((fp=fopen(path,"w")) == NULL) {
+ 		perror("cmkdir");
+ 		exit(1);
+ 	}
+ 	fprintf(fp,"%d\n",smsize);
  	fclose(fp);
  	if (cfmt) {
  		sprintf(path,"%s/..k",argv[0]);
diff -c ./cname.8 ../cfs131/cname.8
*** ./cname.8	Sat Jul 22 23:13:41 1995
--- ../cfs131/cname.8	Fri Oct 27 12:51:07 1995
***************
*** 3,9 ****
  cname
  .SH SYNOPSIS
  .B cname
! [ \-\fB3m\fP ]
  [ \-\fBv\fP ]
  .SH DESCRIPTION
  \fBcname\fP prompts for a passphrase and reads, from standard input, a
--- 3,9 ----
  cname
  .SH SYNOPSIS
  .B cname
! [ \-\fB3bms\fP ]
  [ \-\fBv\fP ]
  .SH DESCRIPTION
  \fBcname\fP prompts for a passphrase and reads, from standard input, a
***************
*** 11,18 ****
  produces, on standard output, a corresponding list of cleartext names.
  By default, names are decrypted using standard 2-key hybrid mode
  single-DES.  The \-\fB3\fP option specifies 2-key hybrid mode triple
! DES.  \-\fBm\fP specifies 2-key hybrid MacGuffin. The \-\fBv\fP option
! includes the ciphertext names in the output.
  .LP
  All names must be specified one per input line, as individual path
  components (full path names are not accepted).  If a name cannot be
--- 11,19 ----
  produces, on standard output, a corresponding list of cleartext names.
  By default, names are decrypted using standard 2-key hybrid mode
  single-DES.  The \-\fB3\fP option specifies 2-key hybrid mode triple
! DES.  \-\fBm\fP specifies 1-key hybrid MacGuffin. \-\fBs\fP specifies
! SAFER-SK128.  The \-\fBv\fP option includes the ciphertext names in
! the output.
  .LP
  All names must be specified one per input line, as individual path
  components (full path names are not accepted).  If a name cannot be
diff -c ./cname.c ../cfs131/cname.c
*** ./cname.c	Sat Jul 22 23:07:37 1995
--- ../cfs131/cname.c	Fri Oct 27 12:46:03 1995
***************
*** 66,81 ****
  			    case '3':
  				ciph=CFS_THREE_DES;
  				break;
  			    case 'm':
  				ciph=CFS_MACGUFFIN;
  				break;
  			    default:
! 				fprintf(stderr,"usage: cname [-3m]\n");
  				exit(1);
  			}
  	}
  	if (argc!=0) {
! 		fprintf(stderr,"Usage: cname [-3m]\n");
  		exit(1);
  	}
  	if ((pw=getpassword("Key:"))==NULL) {
--- 66,89 ----
  			    case '3':
  				ciph=CFS_THREE_DES;
  				break;
+ #ifdef NOTDEF				
+ 			    case 'b':
+ 				ciph=CFS_BLOWFISH;
+ 				break;
+ #endif				
  			    case 'm':
  				ciph=CFS_MACGUFFIN;
  				break;
+ 			    case 's':
+ 				ciph=CFS_SAFER_SK128;
+ 				break;
  			    default:
! 				fprintf(stderr,"usage: cname [-3bmsv]\n");
  				exit(1);
  			}
  	}
  	if (argc!=0) {
! 		fprintf(stderr,"Usage: cname [-3bmsv]\n");
  		exit(1);
  	}
  	if ((pw=getpassword("Key:"))==NULL) {
diff -c ./cpasswd.c ../cfs131/cpasswd.c
*** ./cpasswd.c	Fri Jul 28 02:44:38 1995
--- ../cfs131/cpasswd.c	Thu Oct 26 15:17:03 1995
***************
*** 32,37 ****
--- 32,40 ----
  #include "admproto.h"
  #include "cfs.h"
  #include "shs.h"
+ #ifdef SOLARIS2X
+ #define getwd(b)        getcwd(b, 1024)
+ #endif
  
  main(argc,argv)
       int argc;
***************
*** 49,55 ****
--- 52,60 ----
  	char opath[1024];
  	char cname[1024];
  	char kname[1024];
+ 	char sname[1024];
  	char dir[1024];
+ 	int smsize;
  	FILE *fp;
  	char *flg;
  	int ciph=CFS_STD_DES;
***************
*** 83,88 ****
--- 88,94 ----
  
  	sprintf(cname,"%s/..c",dir);
  	sprintf(kname,"%s/..k",dir);
+ 	sprintf(sname,"%s/..s",dir);
  	if ((fp=fopen(cname,"r")) == NULL) {
  		fprintf(stderr,"Can only change passphrase on new format CFS directories\n");
  		exit(1);
***************
*** 96,106 ****
--- 102,124 ----
  		exit(1);
  	}
  	fclose(fp);
+ 	if ((fp=fopen(sname,"r")) == NULL) {
+ 		smsize=LARGESMSIZE;
+ 	} else {
+ 		if (fscanf(fp,"%d",&amp;smsize) != 1)
+ 			smsize=LARGESMSIZE;
+ 		fclose(fp);
+ 		if ((smsize &lt; CFSBLOCK) || (smsize &gt; (LARGESMSIZE*2)))
+ 			smsize=LARGESMSIZE;
+ 	}
+ 
  	oldkey.cipher=ciph;
  	if ((pw=getpassword("Old passphrase:"))==NULL) {
  		fprintf(stderr,"Can't get key\n");
  		exit(1);
  	}
+ 	if (smsize != LARGESMSIZE)
+ 		sprintf(pw,"%s%d",pw,smsize);
  	if (new_pwcrunch(pw,&amp;oldkey)!=0) {
  		fprintf(stderr,"Invalid key\n");
  		exit(1);
***************
*** 129,134 ****
--- 147,154 ----
  			"Keys don't match; drink some coffee and try again\n");
  		exit(1);
  	}
+ 	if (smsize != LARGESMSIZE)
+ 		sprintf(pw,"%s%d",pw,smsize);
  	if (new_pwcrunch(pw,&amp;newkey)!=0) {
  		fprintf(stderr,"Invalid key\n");
  		exit(1);
diff -c ./esm.c ../cfs131/esm.c
*** ./esm.c	Tue Jul 25 09:07:39 1995
--- ../cfs131/esm.c	Thu Oct 26 15:17:05 1995
***************
*** 1,8 ****
  /*
   * ESM - Encrypted Session Manager
!  * v1.0.0
   * matt blaze
!  * july 1995
   */
  
  /*
--- 1,12 ----
  /*
   * ESM - Encrypted Session Manager
!  * v1.0.1
   * matt blaze
!  * October 1995
!  */
! 
! /* SunOS 5 port by Greg Onufer, based in part on the pty_termios
!  * package written by Don Libes, NIST, 2/6/90
   */
  
  /*
***************
*** 76,81 ****
--- 80,91 ----
  #include &lt;sys/signal.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdio.h&gt;
+ #ifdef SOLARIS2X
+ #include &lt;fcntl.h&gt;
+ #endif
+ #ifdef PTMX
+ #include &lt;stropts.h&gt;
+ #endif
  #include "global.h"
  #include "rsaref.h"
  #include "esm.h"
***************
*** 96,102 ****
--- 106,116 ----
  struct	winsize win;
  int	lb;
  int	l;
+ #ifdef PTMX
+ char	*slave_name;
+ #else
  char	line[] = "/dev/ptyXX";
+ #endif
  int	aflg;
  
  #define REMOTE 0
***************
*** 173,180 ****
  		doshell(mode);
  	else {
  		/* main loop */
! 		printf("ESM v1.0 - encrypted session manager\n");
! 		printf("    by Matt Blaze, AT&amp;T Bell Labs, June 1995\n");
  		randinit();
  		cipherinit();
  		switch (mode) {
--- 187,194 ----
  		doshell(mode);
  	else {
  		/* main loop */
! 		printf("ESM v1.0.1 - encrypted session manager\n");
! 		printf("    by Matt Blaze, AT&amp;T Bell Labs, October 1995\n");
  		randinit();
  		cipherinit();
  		switch (mode) {
***************
*** 634,644 ****
  void
  finish()
  {
! 	union wait status;
  	register int pid;
  	register int die = 0;
  
! 	while ((pid = wait3((int *)&amp;status, WNOHANG, 0)) &gt; 0)
  		if (pid == subchild)
  			die = 1;
  
--- 648,658 ----
  void
  finish()
  {
! 	int status;
  	register int pid;
  	register int die = 0;
  
! 	while ((pid = waitpid((pid_t)-1, &amp;status, WNOHANG)) &gt; 0)
  		if (pid == subchild)
  			die = 1;
  
***************
*** 879,884 ****
--- 893,937 ----
  	exit(0);
  }
  
+ 
+ #ifdef PTMX
+ 
+ getmaster()
+ {
+ 	if ((master = open("/dev/ptmx", O_RDWR)) == -1)
+ 		return (-1);
+ 	if ((slave_name = (char *)ptsname(master)) == NULL ||
+ 		unlockpt(master) ||
+ 		grantpt(master)) {
+ 		close(master);
+ 		fail();
+ 	}
+ 	(void) ioctl(master, TIOCFLUSH, NULL);
+ 	(void) tcgetattr(0, &amp;tt);
+     	(void) ioctl(0, TIOCGWINSZ, (char *)&amp;win);
+ }
+ 
+ getslave()
+ {
+ 	(void) setsid();
+ 	if ((slave = open(slave_name, O_RDWR)) &lt; 0) {
+ 		fail();
+ 	}
+         if (ioctl(slave, I_PUSH, "ptem")) {
+ 		fail();
+         }
+         if (ioctl(slave, I_PUSH, "ldterm")) {
+ 		fail();
+         }
+         if (ioctl(slave, I_PUSH, "ttcompat")) {
+ 		fail();
+         }
+ 	(void) tcsetattr(slave, TCSAFLUSH, &amp;tt);
+ 	(void) ioctl(slave, TIOCSWINSZ, (char *)&amp;win);
+ }
+ 
+ #else
+ 
  getmaster()
  {
  	char *pty, *bank, *cp;
***************
*** 929,934 ****
--- 982,989 ----
  	(void) setsid();
  	(void) ioctl(slave, TIOCSCTTY, 0);
  }
+ 
+ #endif
  
  waitenter()
  {
diff -c ./getpass.c ../cfs131/getpass.c
*** ./getpass.c	Sun Jul 23 00:25:36 1995
--- ../cfs131/getpass.c	Fri Oct 27 12:48:02 1995
***************
*** 130,135 ****
--- 130,148 ----
  		bcopy(k1,k-&gt;cfs_admkey_u.mcgkey.secondary,8);
  		bcopy(k2,&amp;(k-&gt;cfs_admkey_u.mcgkey.secondary[8]),8);
  		break;
+ #ifdef NOTDEF
+ 	    case CFS_BLOWFISH:
+ 		bcopy(k1,k-&gt;cfs_admkey_u.blowkey.primary,8);
+ 		bcopy(k2,&amp;(k-&gt;cfs_admkey_u.blowkey.primary[8]),8);
+ 		bcopy(k1,k-&gt;cfs_admkey_u.blowkey.secondary,8);
+ 		bcopy(k2,&amp;(k-&gt;cfs_admkey_u.blowkey.secondary[8]),8);
+ 		break;
+ #endif
+ 	    case CFS_SAFER_SK128:
+ 		bcopy(k1,k-&gt;cfs_admkey_u.saferkey.primary,8);
+ 		bcopy(k2,&amp;(k-&gt;cfs_admkey_u.saferkey.primary[8]),8);
+ 		bcopy(k1,k-&gt;cfs_admkey_u.saferkey.secondary,8);
+ 		bcopy(k2,&amp;(k-&gt;cfs_admkey_u.saferkey.secondary[8]),8);
  	    default:
  		break;
  	}
***************
*** 164,169 ****
--- 177,192 ----
  		bcopy(k1,k-&gt;cfs_admkey_u.mcgkey.primary,16);
  		bcopy(k1,k-&gt;cfs_admkey_u.mcgkey.secondary,16);
  		break;
+ #ifdef NOTDEF
+ 	    case CFS_BLOWFISH:
+ 		bcopy(k1,k-&gt;cfs_admkey_u.blowkey.primary,16);
+ 		bcopy(k1,k-&gt;cfs_admkey_u.blowkey.secondary,16);
+ 		break;
+ #endif		
+ 	    case CFS_SAFER_SK128:
+ 		bcopy(k1,k-&gt;cfs_admkey_u.saferkey.primary,16);
+ 		bcopy(k1,k-&gt;cfs_admkey_u.saferkey.secondary,16);
+ 		break;
  	    default:
  		break;
  	}
***************
*** 175,180 ****
--- 198,207 ----
       u_char *ek;
  {
  	mcg_key mk;
+ #ifdef NOTDEF
+ 	bfkey bk;
+ #endif	
+ 	safer_key_t sk;
  	
  	switch (k-&gt;cipher) {
  	    case CFS_STD_DES:
***************
*** 206,222 ****
  		bcopy(ek,k-&gt;cfs_admkey_u.mcgkey.primary,16);
  		bcopy(ek,k-&gt;cfs_admkey_u.mcgkey.secondary,16);
  		break;
  	    default:
  		break;
  	}
  }
  encrypt_key(k,ek)
       cfs_admkey *k;
       u_char *ek;
  {
  	mcg_key mk;
! 		
! 	
  	switch (k-&gt;cipher) {
  	    case CFS_STD_DES:
  		q_block_cipher(k-&gt;cfs_admkey_u.deskey.primary,&amp;(ek[0]),0);
--- 233,273 ----
  		bcopy(ek,k-&gt;cfs_admkey_u.mcgkey.primary,16);
  		bcopy(ek,k-&gt;cfs_admkey_u.mcgkey.secondary,16);
  		break;
+ #ifdef NOTDEF		
+ 	    case CFS_BLOWFISH:
+ 		Blowfish_Initialize(k-&gt;cfs_admkey_u.blowkey.primary,16,&amp;bk);
+ 		Blowfish_decipher(&amp;(ek[0]),&amp;bk);
+ 		Blowfish_decipher(&amp;(ek[8]),&amp;bk);
+ 		bcopy(ek,k-&gt;cfs_admkey_u.blowkey.primary,16);
+ 		bcopy(ek,k-&gt;cfs_admkey_u.blowkey.secondary,16);
+ 		break;
+ #endif
+ 	    case CFS_SAFER_SK128:
+ 		Safer_Init_Module();
+ 		Safer_Expand_Userkey(k-&gt;cfs_admkey_u.saferkey.primary,
+ 				     &amp;(k-&gt;cfs_admkey_u.saferkey.primary[8]),
+ 				     SAFER_SK128_DEFAULT_NOF_ROUNDS, 1,
+ 				     sk);
+ 		Safer_Decrypt_Block(&amp;(ek[0]),sk,&amp;(ek[0]));
+ 		Safer_Decrypt_Block(&amp;(ek[8]),sk,&amp;(ek[8]));
+ 		bcopy(ek,k-&gt;cfs_admkey_u.saferkey.primary,16);
+ 		bcopy(ek,k-&gt;cfs_admkey_u.saferkey.secondary,16);
+ 		break;
  	    default:
  		break;
  	}
  }
+ 
  encrypt_key(k,ek)
       cfs_admkey *k;
       u_char *ek;
  {
  	mcg_key mk;
! #ifdef NOTDEF	
! 	bfkey bk;
! #endif	
! 	safer_key_t sk;
! 
  	switch (k-&gt;cipher) {
  	    case CFS_STD_DES:
  		q_block_cipher(k-&gt;cfs_admkey_u.deskey.primary,&amp;(ek[0]),0);
***************
*** 234,247 ****
  		q_block_cipher(k-&gt;cfs_admkey_u.des3key.primary2,&amp;(ek[8]),1);
  		q_block_cipher(k-&gt;cfs_admkey_u.des3key.primary1,&amp;(ek[8]),0);
  		break;
  	    case CFS_MACGUFFIN:
  		mcg_keyset(k-&gt;cfs_admkey_u.mcgkey.primary,&amp;mk);
  		mcg_block_encrypt(&amp;mk,&amp;(ek[0]));
  		mcg_block_encrypt(&amp;mk,&amp;(ek[8]));
  		break;
  	    default:
  		break;
  	}
  }
- 
- 
--- 285,312 ----
  		q_block_cipher(k-&gt;cfs_admkey_u.des3key.primary2,&amp;(ek[8]),1);
  		q_block_cipher(k-&gt;cfs_admkey_u.des3key.primary1,&amp;(ek[8]),0);
  		break;
+ #ifdef NOTDEF		
+ 	    case CFS_BLOWFISH:
+ 		Blowfish_Initialize(k-&gt;cfs_admkey_u.blowkey.primary,16,&amp;bk);
+ 		Blowfish_encipher(&amp;(ek[0]),&amp;bk);
+ 		Blowfish_encipher(&amp;(ek[8]),&amp;bk);
+ 		break;
+ #endif		
  	    case CFS_MACGUFFIN:
  		mcg_keyset(k-&gt;cfs_admkey_u.mcgkey.primary,&amp;mk);
  		mcg_block_encrypt(&amp;mk,&amp;(ek[0]));
  		mcg_block_encrypt(&amp;mk,&amp;(ek[8]));
  		break;
+ 	    case CFS_SAFER_SK128:
+ 		Safer_Init_Module();
+ 		Safer_Expand_Userkey(k-&gt;cfs_admkey_u.saferkey.primary,
+ 				     &amp;(k-&gt;cfs_admkey_u.saferkey.primary[8]),
+ 				     SAFER_SK128_DEFAULT_NOF_ROUNDS, 1,
+ 				     sk);
+ 		Safer_Encrypt_Block(&amp;(ek[0]),sk,&amp;(ek[0]));
+ 		Safer_Encrypt_Block(&amp;(ek[8]),sk,&amp;(ek[8]));
+ 		break;
  	    default:
  		break;
  	}
  }
diff -c ./notes.ms ../cfs131/notes.ms
*** ./notes.ms	Fri Jul 28 02:48:42 1995
--- ../cfs131/notes.ms	Fri Oct 27 13:09:09 1995
***************
*** 5,12 ****
  Matt Blaze
  .AI
  AT&amp;T Bell Laboratories
! 101 Crawfords Corner Road, Room 4G-634
! Holmdel, NJ 07733
  
  mab@research.att.com
  (for cfs questions, use cfs@research.att.com)
--- 5,12 ----
  Matt Blaze
  .AI
  AT&amp;T Bell Laboratories
! 600 Mountain Avenue, Room 2A-360C
! Murray Hill, NJ 07974
  
  mab@research.att.com
  (for cfs questions, use cfs@research.att.com)
***************
*** 304,309 ****
--- 304,316 ----
  mountd and nfsd if it's there; you'll have to edit out any lines that
  try to start up nfsd on such systems.
  .PP
+ Some systems (e.g., Solaris, Irix, etc.) don't use /etc/rc as the
+ startup file or have different options on some of the mount commands.
+ The basic idea, however, is the same: configure your system so that
+ when it boots it first starts mountd (with something exported to
+ localhost), then starts cfsd, and finally mounts cfsd at the /crypt
+ mountpoint.
+ .PP
  On some platforms (especially BSDI), you may find that CFS performance
  improves dramatically if you set the NFS mount block size to a smaller
  value than the default.  2048 is usually about right:
***************
*** 366,380 ****
  user-selected key passphrases represents a much greater practical
  threat than a direct attack against even single DES.
  .PP
! A new experimental block cipher, called "MacGuffin" and designed by
! Bruce Schneier and I, is also included in this release.  You can use
! it by including the "-m" option to cmkdir.  This cipher is strictly
! experimental, and I do not yet suggest its use for protecting
! sensitive data.  It is included only to encourage analysis and testing
! and to provide a demonstration of how to link in new ciphers to CFS.
! It should be assumed to be weaker than DES.  The cipher has a nominal
! keyspace of 128 bits, 32 rounds and a standard 64 bit codebook
! interface.  It is described in:
  .IP
  Matt Blaze and Bruce Schneier, "The MacGuffin Block Cipher Algorithm."
  .I
--- 373,389 ----
  user-selected key passphrases represents a much greater practical
  threat than a direct attack against even single DES.
  .PP
! CFS now supports two new ciphers in addition to DES and 3DES:
! "MacGuffin" and "SAFER-SK128".
! .PP
! "MacGuffin" is an experimental cipher designed by Bruce Schneier and
! I.  You can use it by including the "-m" option to cmkdir.  This
! cipher is strictly experimental, and I do not yet suggest its use for
! protecting sensitive data.  It is included only to encourage analysis
! and testing and to provide a demonstration of how to link in new
! ciphers to CFS.  It should be assumed to be weaker than DES.  The
! cipher has a nominal keyspace of 128 bits, 32 rounds and a standard 64
! bit codebook interface.  It is described in:
  .IP
  Matt Blaze and Bruce Schneier, "The MacGuffin Block Cipher Algorithm."
  .I
***************
*** 382,393 ****
  .R
  Leuven, Belgium, December 1994.
  .PP
  CFS 1.3 now stores keys in a "keyfile" in the encrypted directory,
  using the initial passphrase as seed key material and to encrypt the
  keyfile.  This allows you to change the passphrase without re-creating
! copying the directory (see cpasswd(1)).  A future release of CFS will
! allow multiple users of the same CFS directories to have their own
! passphrases.
  .PP
  CFS semantics should be roughly the same as those of any other
  NFS-mounted file system, with a couple of minor differences.  Because
--- 391,422 ----
  .R
  Leuven, Belgium, December 1994.
  .PP
+ "SAFER-SK128" is a new public domain cipher designed by James
+ L. Massey.  The implementation in CFS is based on the SAFER C language
+ reference implementation by Richard De Moliner of the Swiss Federal
+ Institute of Technology.  You can specify SAFER with the "-s" option
+ to cmkdir.  SAFER is described in:
+ .IP
+ Massey, J.L., "SAFER K-64: A Byte-Oriented Block Ciphering Algorithm",
+ pp. 1-17 in
+ .I
+ Fast Software Encryption
+ .R
+ (Ed. R. Anderson), Proceedings of the Cambridge Security Workshop,
+ Cambridge, U.K., Dec. 9-11, 1993, Lecture Notes in Computer Science No. 809.
+ Heidelberg and New York: Springer, 1994.
+ .LP
+ and in
+ .IP
+ Massey, J.L., "Announcement of a Strengthened Key Schedule for the
+ Cipher SAFER", Sept. 9, 1995.
+ .PP
  CFS 1.3 now stores keys in a "keyfile" in the encrypted directory,
  using the initial passphrase as seed key material and to encrypt the
  keyfile.  This allows you to change the passphrase without re-creating
! or copying the directory (see cpasswd(1)).  A future release of CFS
! will allow multiple users of the same CFS directories to have their
! own passphrases.
  .PP
  CFS semantics should be roughly the same as those of any other
  NFS-mounted file system, with a couple of minor differences.  Because
***************
*** 434,449 ****
  .PP
  cfsd uses lots of memory for each attached directory.  If you must
  install CFS on a multiuser system, you should reduce NINSTANCES (in
! cfs.h) to a small enough value to avoid thrashing.
  .PP
  This release makes it reasonably easy to add other 64 bit codebook
  ciphers.  To add a cipher, you'll need to provide a block encrypt/
  decrypt function and add hooks for it in the following routines:
! \fIcipher(), mask_cipher(), pwcrunch(),\fP and \fIcopykey().\fP  You'll
! also need to modify \fIcmkdir.c, admproto.x, and cfs.h\fP to refer to the
! new cipher.  If your cipher does not have a 64 bit codebook mode, it
! will be more painful to add, since CFS assumes this size in far too many
! places.
  .PP
  The file ver.c contains a static string with information on the
  version of CFS from which it was derived.  In particular,
--- 463,484 ----
  .PP
  cfsd uses lots of memory for each attached directory.  If you must
  install CFS on a multiuser system, you should reduce NINSTANCES (in
! cfs.h) to a small enough value to avoid thrashing.  Using the -p
! ("puny") option on cmkdir creates directories that use much less
! memory than normal, at the expense of revealing a little bit more
! about the structure of very large files.
  .PP
  This release makes it reasonably easy to add other 64 bit codebook
  ciphers.  To add a cipher, you'll need to provide a block encrypt/
  decrypt function and add hooks for it in the following routines:
! \fIcipher(), mask_cipher(), pwcrunch(),\fP and \fIcopykey()\fP.  These
! routines can be found in \fIcfs_cipher.c\fP and \fIgetpass.c\fP.
! You'll also need to modify \fIcmkdir.c, cname.c, ccat.c,
! admproto.x,\fP and \fIcfs.h\fP to refer to the new cipher, as well as
! the adding references to the cipher module in various places in the
! Makefile.  If your cipher does not have a 64 bit codebook mode, it
! will be more painful to add, since CFS assumes this size in far too
! many places.
  .PP
  The file ver.c contains a static string with information on the
  version of CFS from which it was derived.  In particular,
***************
*** 465,473 ****
  CFS was ported to HP/UX, Irix, Linux and AIX by Mark Henderson
  (markh@wimsey.com).  Ed Gould (ed@left.wing.org) made CFS work under
  Ultrix 4.2.  Solaris 2.3 support was added by Mark Stein
! (Mark.Stein@Eng.Sun.COM).  Several other users contributed bug
! reports, suggestions, and advice.  Thanks!
  .LP
! July 22, 1995
! 
! 
--- 500,508 ----
  CFS was ported to HP/UX, Irix, Linux and AIX by Mark Henderson
  (markh@wimsey.com).  Ed Gould (ed@left.wing.org) made CFS work under
  Ultrix 4.2.  Solaris 2.3 support was added by Mark Stein
! (Mark.Stein@Eng.Sun.COM), with additional patches from Christopher
! Oliver (oliver@fritz.co.traverse.com) and Greg Onufer
! (Greg.Onufer@Eng.Sun.COM).  Many other users contributed bug reports,
! suggestions, and advice.  Thanks!
  .LP
! October 24, 1995
diff -c ./safer.c ../cfs131/safer.c
*** ./safer.c	Fri Oct 27 13:16:34 1995
--- ../cfs131/safer.c	Thu Oct 26 15:17:04 1995
***************
*** 0 ****
--- 1,195 ----
+ /*******************************************************************************
+ *
+ * FILE:           safer.c
+ *
+ * DESCRIPTION:    block-cipher algorithm SAFER (Secure And Fast Encryption
+ *                 Routine) in its four versions: SAFER K-64, SAFER K-128,
+ *                 SAFER SK-64 and SAFER SK-128.
+ *
+ * AUTHOR:         Richard De Moliner (demoliner@isi.ee.ethz.ch)
+ *                 Signal and Information Processing Laboratory
+ *                 Swiss Federal Institute of Technology
+ *                 CH-8092 Zuerich, Switzerland
+ *
+ * DATE:           September 9, 1995
+ *
+ * CHANGE HISTORY:
+ *
+ *******************************************************************************/
+ 
+ /******************* External Headers *****************************************/
+ 
+ /******************* Local Headers ********************************************/
+ #include "safer.h"
+ 
+ /******************* Constants ************************************************/
+ #define TAB_LEN      256
+ 
+ /******************* Assertions ***********************************************/
+ 
+ /******************* Macros ***************************************************/
+ #define ROL(x, n)    ((unsigned char)((unsigned int)(x) &lt;&lt; (n)\
+                                      |(unsigned int)((x) &amp; 0xFF) &gt;&gt; (8 - (n))))
+ #define EXP(x)       exp_tab[(x) &amp; 0xFF]
+ #define LOG(x)       log_tab[(x) &amp; 0xFF]
+ #define PHT(x, y)    { y += x; x += y; }
+ #define IPHT(x, y)   { x -= y; y -= x; }
+ 
+ /******************* Types ****************************************************/
+ static unsigned char exp_tab[TAB_LEN];
+ static unsigned char log_tab[TAB_LEN];
+ 
+ /******************* Module Data **********************************************/
+ 
+ /******************* Functions ************************************************/
+ 
+ /******************************************************************************/
+ #ifndef NOT_ANSI_C
+     void Safer_Init_Module(void)
+ #else
+     Safer_Init_Module()
+ #endif
+ 
+ {   unsigned int i, exp;
+ 
+     exp = 1;
+     for (i = 0; i &lt; TAB_LEN; i++)
+     {
+         exp_tab[i] = (unsigned char)(exp &amp; 0xFF);
+         log_tab[exp_tab[i]] = (unsigned char)i;
+         exp = exp * 45 % 257;
+     }
+ } /* Safer_Init_Module */
+ 
+ /******************************************************************************/
+ #ifndef NOT_ANSI_C
+     void Safer_Expand_Userkey(safer_block_t userkey_1,
+                               safer_block_t userkey_2,
+                               unsigned int nof_rounds,
+                               int strengthened,
+                               safer_key_t key)
+ #else
+     Safer_Expand_Userkey(userkey_1, userkey_2, nof_rounds, strengthened, key)
+     safer_block_t userkey_1;
+     safer_block_t userkey_2;
+     unsigned int nof_rounds;
+     int strengthened;
+     safer_key_t key;
+ #endif
+ 
+ {   unsigned int i, j;
+     unsigned char ka[SAFER_BLOCK_LEN + 1];
+     unsigned char kb[SAFER_BLOCK_LEN + 1];
+ 
+     if (SAFER_MAX_NOF_ROUNDS &lt; nof_rounds)
+         nof_rounds = SAFER_MAX_NOF_ROUNDS;
+     *key++ = (unsigned char)nof_rounds;
+     ka[SAFER_BLOCK_LEN] = 0;
+     kb[SAFER_BLOCK_LEN] = 0;
+     for (j = 0; j &lt; SAFER_BLOCK_LEN; j++)
+     {
+         ka[SAFER_BLOCK_LEN] ^= ka[j] = ROL(userkey_1[j], 5);
+         kb[SAFER_BLOCK_LEN] ^= kb[j] = *key++ = userkey_2[j];
+     }
+     for (i = 1; i &lt;= nof_rounds; i++)
+     {
+         for (j = 0; j &lt; SAFER_BLOCK_LEN + 1; j++)
+         {
+             ka[j] = ROL(ka[j], 6);
+             kb[j] = ROL(kb[j], 6);
+         }
+         for (j = 0; j &lt; SAFER_BLOCK_LEN; j++)
+             if (strengthened)
+                 *key++ = (ka[(j + 2 * i - 1) % (SAFER_BLOCK_LEN + 1)]
+                                 + exp_tab[exp_tab[18 * i + j + 1]]) &amp; 0xFF;
+             else
+                 *key++ = (ka[j] + exp_tab[exp_tab[18 * i + j + 1]]) &amp; 0xFF;
+         for (j = 0; j &lt; SAFER_BLOCK_LEN; j++)
+             if (strengthened)
+                 *key++ = (kb[(j + 2 * i) % (SAFER_BLOCK_LEN + 1)]
+                                 + exp_tab[exp_tab[18 * i + j + 10]]) &amp; 0xFF;
+             else
+                 *key++ = (kb[j] + exp_tab[exp_tab[18 * i + j + 10]]) &amp; 0xFF;
+     }
+     for (j = 0; j &lt; SAFER_BLOCK_LEN + 1; j++)
+         ka[j] = kb[j] = 0;
+ } /* Safer_Expand_Userkey */
+ 
+ /******************************************************************************/
+ #ifndef NOT_ANSI_C
+     void Safer_Encrypt_Block(safer_block_t block_in, safer_key_t key, 
+                              safer_block_t block_out)
+ #else
+     Safer_Encrypt_Block(block_in, key, block_out)
+     safer_block_t block_in;
+     safer_key_t key;
+     safer_block_t block_out;
+ #endif
+ 
+ {   unsigned char a, b, c, d, e, f, g, h, t;
+     unsigned int round;
+ 
+     a = block_in[0]; b = block_in[1]; c = block_in[2]; d = block_in[3];
+     e = block_in[4]; f = block_in[5]; g = block_in[6]; h = block_in[7];
+     if (SAFER_MAX_NOF_ROUNDS &lt; (round = *key)) round = SAFER_MAX_NOF_ROUNDS;
+     while(round--)
+     {
+         a ^= *++key; b += *++key; c += *++key; d ^= *++key;
+         e ^= *++key; f += *++key; g += *++key; h ^= *++key;
+         a = EXP(a) + *++key; b = LOG(b) ^ *++key;
+         c = LOG(c) ^ *++key; d = EXP(d) + *++key;
+         e = EXP(e) + *++key; f = LOG(f) ^ *++key;
+         g = LOG(g) ^ *++key; h = EXP(h) + *++key;
+         PHT(a, b); PHT(c, d); PHT(e, f); PHT(g, h);
+         PHT(a, c); PHT(e, g); PHT(b, d); PHT(f, h);
+         PHT(a, e); PHT(b, f); PHT(c, g); PHT(d, h);
+         t = b; b = e; e = c; c = t; t = d; d = f; f = g; g = t;
+     }
+     a ^= *++key; b += *++key; c += *++key; d ^= *++key;
+     e ^= *++key; f += *++key; g += *++key; h ^= *++key;
+     block_out[0] = a &amp; 0xFF; block_out[1] = b &amp; 0xFF;
+     block_out[2] = c &amp; 0xFF; block_out[3] = d &amp; 0xFF;
+     block_out[4] = e &amp; 0xFF; block_out[5] = f &amp; 0xFF;
+     block_out[6] = g &amp; 0xFF; block_out[7] = h &amp; 0xFF;
+ } /* Safer_Encrypt_Block */
+ 
+ /******************************************************************************/
+ #ifndef NOT_ANSI_C
+     void Safer_Decrypt_Block(safer_block_t block_in, safer_key_t key, 
+                              safer_block_t block_out)
+ #else
+     Safer_Decrypt_Block(block_in, key, block_out)
+     safer_block_t block_in;
+     safer_key_t key;
+     safer_block_t block_out;
+ #endif
+ 
+ {   unsigned char a, b, c, d, e, f, g, h, t;
+     unsigned int round;
+ 
+     a = block_in[0]; b = block_in[1]; c = block_in[2]; d = block_in[3];
+     e = block_in[4]; f = block_in[5]; g = block_in[6]; h = block_in[7];
+     if (SAFER_MAX_NOF_ROUNDS &lt; (round = *key)) round = SAFER_MAX_NOF_ROUNDS;
+     key += SAFER_BLOCK_LEN * (1 + 2 * round);
+     h ^= *key; g -= *--key; f -= *--key; e ^= *--key;
+     d ^= *--key; c -= *--key; b -= *--key; a ^= *--key;
+     while (round--)
+     {
+         t = e; e = b; b = c; c = t; t = f; f = d; d = g; g = t;
+         IPHT(a, e); IPHT(b, f); IPHT(c, g); IPHT(d, h);
+         IPHT(a, c); IPHT(e, g); IPHT(b, d); IPHT(f, h);
+         IPHT(a, b); IPHT(c, d); IPHT(e, f); IPHT(g, h);
+         h -= *--key; g ^= *--key; f ^= *--key; e -= *--key;
+         d -= *--key; c ^= *--key; b ^= *--key; a -= *--key;
+         h = LOG(h) ^ *--key; g = EXP(g) - *--key;
+         f = EXP(f) - *--key; e = LOG(e) ^ *--key;
+         d = LOG(d) ^ *--key; c = EXP(c) - *--key;
+         b = EXP(b) - *--key; a = LOG(a) ^ *--key;
+     }
+     block_out[0] = a &amp; 0xFF; block_out[1] = b &amp; 0xFF;
+     block_out[2] = c &amp; 0xFF; block_out[3] = d &amp; 0xFF;
+     block_out[4] = e &amp; 0xFF; block_out[5] = f &amp; 0xFF;
+     block_out[6] = g &amp; 0xFF; block_out[7] = h &amp; 0xFF;
+ } /* Safer_Decrypt_Block */
+ 
+ /******************************************************************************/
diff -c ./safer.h ../cfs131/safer.h
*** ./safer.h	Fri Oct 27 13:16:34 1995
--- ../cfs131/safer.h	Thu Oct 26 16:04:04 1995
***************
*** 0 ****
--- 1,110 ----
+ /*******************************************************************************
+ *
+ * FILE:           safer.h
+ *
+ * DESCRIPTION:    block-cipher algorithm SAFER (Secure And Fast Encryption
+ *                 Routine) in its four versions: SAFER K-64, SAFER K-128,
+ *                 SAFER SK-64 and SAFER SK-128.
+ *
+ * AUTHOR:         Richard De Moliner (demoliner@isi.ee.ethz.ch)
+ *                 Signal and Information Processing Laboratory
+ *                 Swiss Federal Institute of Technology
+ *                 CH-8092 Zuerich, Switzerland
+ *
+ * DATE:           September 9, 1995
+ *
+ * CHANGE HISTORY:
+ *
+ *******************************************************************************/
+ #ifndef SAFER_H
+ #define SAFER_H
+ 
+ /******************* External Headers *****************************************/
+ 
+ /******************* Local Headers ********************************************/
+  
+ /******************* Constants ************************************************/
+ #define SAFER_K64_DEFAULT_NOF_ROUNDS     6
+ #define SAFER_K128_DEFAULT_NOF_ROUNDS   10
+ #define SAFER_SK64_DEFAULT_NOF_ROUNDS    8
+ #define SAFER_SK128_DEFAULT_NOF_ROUNDS  10
+ #define SAFER_MAX_NOF_ROUNDS            13
+ #define SAFER_BLOCK_LEN                  8
+ #define SAFER_KEY_LEN     (1 + SAFER_BLOCK_LEN * (1 + 2 * SAFER_MAX_NOF_ROUNDS))
+ 
+ /******************* Assertions ***********************************************/
+ 
+ /******************* Macros ***************************************************/
+  
+ /******************* Types ****************************************************/
+ typedef unsigned char safer_block_t[SAFER_BLOCK_LEN];
+ typedef unsigned char safer_key_t[SAFER_KEY_LEN];
+ 
+ /******************* Module Data **********************************************/
+ 
+ /******************* Prototypes ***********************************************/
+ 
+ /*******************************************************************************
+ * void Safer_Init_Module(void)
+ *
+ *   initializes this module.
+ *
+ ********************************************************************************
+ * void Safer_Expand_Userkey(safer_block_t userkey_1,
+ *                           safer_block_t userkey_2,
+ *                           unsigned int nof_rounds,
+ *                           int strengthened,
+ *                           safer_key_t key)
+ *
+ *   expands a user-selected key of length 64 bits or 128 bits to a encryption /
+ *   decryption key. If your user-selected key is of length 64 bits, then give
+ *   this key to both arguments 'userkey_1' and 'userkey_2', e.g.
+ *   'Safer_Expand_Userkey(z, z, key)'. Note: SAFER K-64 and SAFER SK-64 with a
+ *   user-selected key 'z' of length 64 bits are identical to SAFER K-128 and
+ *   SAFER SK-128 with a user-selected key 'z z' of length 128 bits,
+ *   respectively.
+ *   pre:  'userkey_1'  contains the first 64 bits of user key.
+ *         'userkey_2'  contains the second 64 bits of user key.
+ *         'nof_rounds' contains the number of encryption rounds
+ *                      'nof_rounds' &lt;= 'SAFER_MAX_NOF_ROUNDS'
+ *         'strengthened' is non-zero if the strengthened key schedule should be
+ *                      used and zero if the original key schedule should be
+ *                      used.
+ *   post: 'key'        contains the expanded key.
+ *
+ ********************************************************************************
+ * void Safer_Encrypt_Block(safer_block_t block_in, safer_key_t key, 
+ *                          safer_block_t block_out)
+ *
+ *   encryption algorithm.
+ *   pre:  'block_in'  contains the plain-text block.
+ *         'key'       contains the expanded key.
+ *   post: 'block_out' contains the cipher-text block.
+ *
+ ********************************************************************************
+ * void Safer_Decrypt_Block(safer_block_t block_in, safer_key_t key,
+ *                          safer_block_t block_out)
+ *
+ *   decryption algorithm.
+ *   pre:  'block_in'  contains the cipher-text block.
+ *         'key'       contains the expanded key.
+ *   post: 'block_out' contains the plain-text block.
+ *
+ *******************************************************************************/
+ 
+ #ifndef NOT_ANSI_C
+     extern void Safer_Init_Module(void);
+     extern void Safer_Expand_Userkey(safer_block_t userkey_1,
+                                      safer_block_t userkey_2,
+                                      unsigned int nof_rounds,
+                                      int strengthened,
+                                      safer_key_t key);
+     extern void Safer_Encrypt_Block (safer_block_t block_in, safer_key_t key, 
+                                      safer_block_t block_out);
+     extern void Safer_Decrypt_Block (safer_block_t block_in, safer_key_t key,
+                                      safer_block_t block_out);
+ #else
+ #endif
+ 
+ /******************************************************************************/
+ #endif /* SAFER_H */
diff -c ./truerand.c ../cfs131/truerand.c
*** ./truerand.c	Sun Jul 23 18:53:38 1995
--- ../cfs131/truerand.c	Thu Oct 26 15:17:03 1995
***************
*** 1,10 ****
  /*
   *	Physically random numbers (very nearly uniform)
   *	D. P. Mitchell 
!  * 		hacked by mab
   */
  /*
!  * The author of this software is Don Mitchell.
   *              Copyright (c) 1995 by AT&amp;T.
   * Permission to use, copy, and modify this software without fee
   * is hereby granted, provided that this entire notice is included in
--- 1,10 ----
  /*
   *	Physically random numbers (very nearly uniform)
   *	D. P. Mitchell 
!  *	Modified by Matt Blaze 2/95
   */
  /*
!  * The authors of this software are Don Mitchell and Matt Blaze.
   *              Copyright (c) 1995 by AT&amp;T.
   * Permission to use, copy, and modify this software without fee
   * is hereby granted, provided that this entire notice is included in
***************
*** 12,18 ****
   * modification of this software and in all copies of the supporting
   * documentation for such software.
   *
!  * This software is subject to United States export controls.
   *
   * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
   * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR AT&amp;T MAKE ANY
--- 12,18 ----
   * modification of this software and in all copies of the supporting
   * documentation for such software.
   *
!  * This software may be subject to United States export controls.
   *
   * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
   * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR AT&amp;T MAKE ANY
***************
*** 20,25 ****
--- 20,43 ----
   * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
   */
  
+ /*
+  * WARNING: depending on the particular platform, truerand() output may
+  * be biased or correlated.  In general, you can expect about 16 bits of
+  * "pseudo-entropy" out of each 32 bit word returned by truerand(),
+  * but it may not be uniformly diffused.  You should therefore run
+  * the output through some post-whitening function (like MD5 or DES or
+  * whatever) before using it to generate key material.  (RSAREF's
+  * random package does this for you when you feed truerand() bits to the
+  * seed input function.)
+  *
+  * Test these assumptions on your own platform before fielding a system
+  * based on this software or these techniques.
+  *
+  * This software seems to work well (at 16 bits per truerand() call) on
+  * a Sun Sparc-20 under SunOS 4.1.3 and on a P100 under BSDI 2.0.  You're
+  * on your own elsewhere.
+  */
+ 
  #include &lt;signal.h&gt;
  #include &lt;setjmp.h&gt;
  #include &lt;sys/time.h&gt;
***************
*** 31,37 ****
  static unsigned ocount;
  static unsigned buffer;
  
! static
  tick()
  {
  	struct itimerval it, oit;
--- 49,55 ----
  static unsigned ocount;
  static unsigned buffer;
  
! static int
  tick()
  {
  	struct itimerval it, oit;
***************
*** 52,60 ****
  	tick();
  }
  
! static unsigned
  roulette()
  {
  	if (setjmp(env)) {
  		count ^= (count&gt;&gt;3) ^ (count&gt;&gt;6) ^ ocount;
  		count &amp;= 0x7;
--- 70,79 ----
  	tick();
  }
  
! static unsigned long
  roulette()
  {
+ 
  	if (setjmp(env)) {
  		count ^= (count&gt;&gt;3) ^ (count&gt;&gt;6) ^ ocount;
  		count &amp;= 0x7;
***************
*** 69,75 ****
  		count++;	/* about 1 MHz on VAX 11/780 */
  }
  
! unsigned
  truerand()
  {
  
--- 88,94 ----
  		count++;	/* about 1 MHz on VAX 11/780 */
  }
  
! unsigned long
  truerand()
  {
  
***************
*** 101,103 ****
--- 120,144 ----
  }
  
  
+ 
+ /*
+  *	Random byte interface to truerand()
+  *	Matt Blaze 5/95
+  *	eight really random bits
+  *	usage: 
+  *		unsigned char r; int randbyte();
+  *		r=randbyte();
+  *	randbyte() takes about .3 seconds on most machines.
+  */
+ 
+ int randbyte()
+ {
+ 	unsigned long truerand();
+ 	unsigned char *shs();
+ 	unsigned long r[2];
+ 	unsigned char *hash;
+ 
+ 	r[0]=truerand(); r[1]=truerand();
+ 	hash = shs(r,sizeof(r));
+ 	return ((int) (*hash)) &amp; 0xff;
+ }
diff -c ./ver.c ../cfs131/ver.c
*** ./ver.c	Mon Jul 24 18:43:38 1995
--- ../cfs131/ver.c	Fri Oct 27 13:22:04 1995
***************
*** 1 ****
! static char version[]="CFS 1.3.0 - cryptlevel: DES=4, 3DES=2, MCG=2";
--- 1 ----
! static char version[]="CFS 1.3.1 - cryptlevel: DES=5, 3DES=3, MCG=3, SAFER=1";

</pre></body></html>