]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Remove local crypto
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 15 Apr 2010 17:40:31 +0000 (18:40 +0100)
committerDerrick Brashear <shadow@dementia.org>
Fri, 19 Nov 2010 13:07:57 +0000 (05:07 -0800)
This change removes all of the local crypto use in userspace, in
favour of using our shiny new afshcrypto library.

Change-Id: Iac21b42e49bac424cc28c449a31f2da44121b7e5
Reviewed-on: http://gerrit.openafs.org/2577
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
187 files changed:
Makefile.in
NTMakefile
configure.ac
src/JAVA/libjafs/Makefile.in
src/WINNT/afsd/NTMakefile
src/WINNT/afsd/krb.h
src/WINNT/afssvrmgr/NTMakefile
src/WINNT/client_creds/NTMakefile
src/WINNT/install/wix/files.wxi
src/afsd/Makefile.in
src/aklog/Makefile.in
src/auth/Makefile.in
src/auth/NTMakefile
src/auth/authcon.c
src/bozo/Makefile.in
src/bozo/NTMakefile
src/bozo/bos.c
src/bozo/bos_util.c
src/bozo/bosoprocs.c
src/bucoord/Makefile.in
src/bucoord/NTMakefile
src/budb/Makefile.in
src/budb/NTMakefile
src/budb/dbs_dump.c
src/budb/procs.c
src/butc/Makefile.in
src/butc/NTMakefile
src/config/NTMakefile
src/crypto/hcrypto/afshcrypto.def
src/des/.gitignore [deleted file]
src/des/Makefile.in [deleted file]
src/des/NTMakefile [deleted file]
src/des/READ_ME [deleted file]
src/des/andrew-conf.h [deleted file]
src/des/cbc_encrypt.c [deleted file]
src/des/cksum.c [deleted file]
src/des/conf-aix-ibm.h [deleted file]
src/des/conf-alpha-bsd.h [deleted file]
src/des/conf-alpha-linux.h [deleted file]
src/des/conf-amd64-linux.h [deleted file]
src/des/conf-arm-linux.h [deleted file]
src/des/conf-bsd-alpha.h [deleted file]
src/des/conf-bsd-i32.h [deleted file]
src/des/conf-bsd-ncr.h [deleted file]
src/des/conf-bsd-sun.h [deleted file]
src/des/conf-bsdvax.h [deleted file]
src/des/conf-darwin.h [deleted file]
src/des/conf-hp9000s300.h [deleted file]
src/des/conf-hp9000s700.h [deleted file]
src/des/conf-hp9000s800.h [deleted file]
src/des/conf-i386-linux.h [deleted file]
src/des/conf-i386-obsd.h [deleted file]
src/des/conf-ia64-linux.h [deleted file]
src/des/conf-ibm370.h [deleted file]
src/des/conf-mips.h [deleted file]
src/des/conf-next.h [deleted file]
src/des/conf-parisc-linux.h [deleted file]
src/des/conf-pc.h [deleted file]
src/des/conf-ppc-darwin.h [deleted file]
src/des/conf-ppc-linux.h [deleted file]
src/des/conf-ppc64-linux.h [deleted file]
src/des/conf-s390-linux.h [deleted file]
src/des/conf-sgi.h [deleted file]
src/des/conf-sparc-linux.h [deleted file]
src/des/conf-sparc64-linux.h [deleted file]
src/des/conf-winnt.h [deleted file]
src/des/conf.h [deleted file]
src/des/config-bsd-mac.h [deleted file]
src/des/crypt.c [deleted file]
src/des/crypt.h [deleted file]
src/des/debug_decl.c [deleted file]
src/des/des.c [deleted file]
src/des/des.h [deleted file]
src/des/des_conf.h [deleted file]
src/des/des_internal.h [deleted file]
src/des/des_prototypes.h [deleted file]
src/des/enc.c [deleted file]
src/des/key_parity.c [deleted file]
src/des/key_sched.c [deleted file]
src/des/main.c [deleted file]
src/des/make_e.c [deleted file]
src/des/make_fp.c [deleted file]
src/des/make_ip.c [deleted file]
src/des/make_keyperm.c [deleted file]
src/des/make_odd.c [deleted file]
src/des/make_p.c [deleted file]
src/des/make_p_table.c [deleted file]
src/des/make_s.c [deleted file]
src/des/make_s_table.c [deleted file]
src/des/misc.c [deleted file]
src/des/mit-cpyright.h [deleted file]
src/des/new_rnd_key.c [deleted file]
src/des/pcbc_encrypt.c [deleted file]
src/des/quad_cksum.c [deleted file]
src/des/read_pssword.c [deleted file]
src/des/s_table.h.ibm [deleted file]
src/des/strng_to_key.c [deleted file]
src/des/tables.h [deleted file]
src/des/test/Makefile.in [deleted file]
src/des/test/NTMakefile [deleted file]
src/des/test/key_test.c [deleted file]
src/des/test/testit.c [deleted file]
src/des/test/verify.c [deleted file]
src/des/util.c [deleted file]
src/des/weak_key.c [deleted file]
src/dviced/Makefile.in
src/dvolser/Makefile.in
src/finale/Makefile.in
src/fsprobe/Makefile.in
src/gtx/Makefile.in
src/kauth/Makefile.in
src/kauth/NTMakefile
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/client.c
src/kauth/crypt.c [new file with mode: 0644]
src/kauth/crypt.h [new file with mode: 0644]
src/kauth/decode_ticket.c
src/kauth/kaprocs.c
src/kauth/kauth_internal.h
src/kauth/kautils.c
src/kauth/kautils.p.h
src/kauth/kpasswd.c
src/kauth/krb_udp.c
src/kauth/prot.h
src/kauth/read_passwd.c [deleted file]
src/kauth/rebuild.c
src/kauth/test/NTMakefile
src/kauth/user.c
src/kauth/user_nt.c
src/libadmin/samples/Makefile.in
src/libadmin/test/Makefile.in
src/libafsauthent/Makefile.in
src/libafsauthent/NTMakefile
src/libafsrpc/Makefile.in
src/libafsrpc/NTMakefile
src/libafsrpc/afsrpc.def
src/libuafs/Makefile.common.in
src/libuafs/MakefileProto.LINUX.in
src/log/Makefile.in
src/packaging/RedHat/openafs.spec.in
src/pam/Makefile.in
src/ptserver/Makefile.in
src/ptserver/NTMakefile
src/rx/rx.c
src/rxkad/Makefile.in
src/rxkad/NTMakefile
src/rxkad/crc.c
src/rxkad/hash.h [deleted file]
src/rxkad/md4.c [deleted file]
src/rxkad/md4.h [deleted file]
src/rxkad/md5.c [deleted file]
src/rxkad/md5.h [deleted file]
src/rxkad/rxkad_prototypes.h
src/rxkad/rxkad_server.c
src/rxkad/test/Makefile.in
src/rxkad/ticket.c
src/rxkad/ticket5.c
src/scout/Makefile.in
src/sgistuff/Makefile.in
src/shlibafsauthent/Makefile.in
src/shlibafsrpc/Makefile.in
src/shlibafsrpc/libafsrpc.map
src/sys/Makefile.in
src/tbudb/Makefile.in
src/tbutc/Makefile.in
src/tbutc/NTMakefile
src/tptserver/Makefile.in
src/tsalvaged/Makefile.in
src/tsm41/Makefile.in
src/tubik/Makefile.in
src/tviced/Makefile.in
src/tvlserver/Makefile.in
src/tvolser/Makefile.in
src/tvolser/NTMakefile
src/update/Makefile.in
src/update/NTMakefile
src/uss/Makefile.in
src/venus/Makefile.in
src/venus/afsio.c
src/venus/test/Makefile.in
src/viced/Makefile.in
src/viced/NTMakefile
src/vlserver/Makefile.in
src/vlserver/NTMakefile
src/volser/Makefile.in
src/volser/NTMakefile

index 20e83240e873e0d4ebbf9ada7234da1abb86d8a8..87b0ec2d342f185dac2000760175e8f947bf1946 100644 (file)
@@ -109,7 +109,7 @@ packages: dest
                echo Not building packages for ${SYS_NAME} ;; \
        esac
 
-${TOP_INCDIR}/afs ${TOP_INCDIR}/rx ${TOP_INCDIR}/des ${TOP_INCDIR}/hcrypto ${TOP_LIBDIR} ${TOP_JLIBDIR}:
+${TOP_INCDIR}/afs ${TOP_INCDIR}/rx ${TOP_INCDIR}/hcrypto ${TOP_LIBDIR} ${TOP_JLIBDIR}:
        mkdir -p $@
 
 install_dirs: force
@@ -135,7 +135,7 @@ dest_dirs: force
        mkdir -p ${DEST}/root.server/etc
        mkdir -p ${DEST}/root.server/usr/afs/bin
 
-prelude: ${TOP_INCDIR}/afs ${TOP_INCDIR}/rx ${TOP_INCDIR}/des ${TOP_INCDIR}/hcrypto ${TOP_LIBDIR}
+prelude: ${TOP_INCDIR}/afs ${TOP_INCDIR}/rx ${TOP_INCDIR}/hcrypto ${TOP_LIBDIR}
 
 project: cmd comerr 
 
@@ -148,7 +148,7 @@ config: prelude
 procmgmt: config
        +${COMPILE_PART1} procmgmt ${COMPILE_PART2}
 
-util: $(DIR_roken) procmgmt des lwp_depinstall rx_depinstall
+util: $(DIR_roken) procmgmt hcrypto lwp_depinstall rx_depinstall
        +${COMPILE_PART1} util ${COMPILE_PART2}
 
 audit: util rx rxkad fsint
@@ -204,16 +204,13 @@ export_build: fsint
 afs: config export comerr afs_depinstall
        +${COMPILE_PART1} afs ${COMPILE_PART2}
 
-des: config
-       +${COMPILE_PART1} des ${COMPILE_PART2}
-
-sys: cmd comerr afs des rx rxstat fsint auth sys_depinstall
+sys: cmd comerr afs hcrypto rx rxstat fsint auth sys_depinstall
        +${COMPILE_PART1} sys ${COMPILE_PART2}
 
-rxkad: cmd comerr des rx rxkad_depinstall
+rxkad: cmd comerr hcrypto rx rxkad_depinstall
        +${COMPILE_PART1} rxkad ${COMPILE_PART2}
 
-auth: cmd comerr des lwp rx rxkad audit sys_depinstall auth_depinstall
+auth: cmd comerr hcrypto lwp rx rxkad audit sys_depinstall auth_depinstall
        +${COMPILE_PART1} auth ${COMPILE_PART2}
 
 ubik: cmd comerr auth ubik_depinstall sys
@@ -357,7 +354,7 @@ fsprobe: cmd comerr util fsint volser
 scout: cmd comerr gtx fsprobe
        +${COMPILE_PART1} scout ${COMPILE_PART2}
 
-uss: des kauth cmd comerr rx vlserver vol volser
+uss: hcrypto kauth cmd comerr rx vlserver vol volser
        +${COMPILE_PART1} uss ${COMPILE_PART2}
 
 bozo: cmd comerr audit auth kauth volser
@@ -491,17 +488,13 @@ libafs_tree: export lwp_depinstall rx_depinstall vlserver_depinstall tvlserver_d
 # libuafs build targets
 #
 
-UKERNELDIR= \
-  des \
-  afsweb 
-
 libuafs_setup: config export
        src/config/config src/libuafs/MakefileProto.${MKAFS_OSTYPE} src/libuafs/Makefile ${SYS_NAME}
 
 libuafs: libuafs_setup vlserver_depinstall tvlserver_depinstall rx_depinstall fsint_depinstall \
                auth_depinstall dir_depinstall libacl_depinstall rxkad_depinstall \
                ubik_depinstall afs_depinstall kauth_depinstall ptserver_depinstall \
-               rxstat_depinstall lwp_depinstall sys_depinstall des cmd
+               rxstat_depinstall lwp_depinstall sys_depinstall cmd hcrypto
        +set -x; \
        case ${SYS_NAME} in \
        hp_ux102* | *_obsd* | sun*_4* | *_nbsd*| hp_ux11i | hp_ux112* | ia64_hpux112*) \
@@ -569,7 +562,7 @@ afsmonitor: cmd comerr gtx xstat
 tests: rxtests ubiktests rpctestlib
 
 # pthread based user space RX library
-libafsrpc: rx rxkad rxstat fsint des
+libafsrpc: rx rxkad rxstat fsint hcrypto
        +case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[of]bsd*|*nbsd[234]*) \
        ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
@@ -594,7 +587,7 @@ libafsauthent: ubik auth kauth libafsrpc
        esac
 
 # pthread based user space RX library
-shlibafsrpc: rx rxstat fsint rxkad des
+shlibafsrpc: rx rxstat fsint rxkad hcrypto
        +case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*_darwin_1*|*nbsd*|*obsd*|*fbsd*) \
        ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \
@@ -709,7 +702,6 @@ clean2:
        -${COMPILE_PART1} fsint ${COMPILE_CLEAN}
        -${COMPILE_PART1} export ${COMPILE_CLEAN}
        -${COMPILE_PART1} afs ${COMPILE_CLEAN}
-       -${COMPILE_PART1} des ${COMPILE_CLEAN}
        -${COMPILE_PART1} sys ${COMPILE_CLEAN}
        -${COMPILE_PART1} rxkad ${COMPILE_CLEAN}
        -${COMPILE_PART1} auth ${COMPILE_CLEAN}
@@ -784,7 +776,7 @@ clean2:
        -${COMPILE_PART1} crypto/hcrypto ${COMPILE_CLEAN}
        -${COMPILE_PART1} roken ${COMPILE_CLEAN}
        -(cd src/libafs; /bin/rm -rf afs afsint config rx)
-       -(cd src/libuafs; /bin/rm -rf afs afsint config rx des)
+       -(cd src/libuafs; /bin/rm -rf afs afsint config rx)
        -/bin/rm -rf ${TOP_INCDIR} ${TOP_LIBDIR} ${TOP_JLIBDIR}
        -/bin/rm -rf libafs_tree ${SYS_NAME}
 
@@ -827,8 +819,6 @@ distclean: clean
        src/config/shlib-build \
        src/config/shlib-install \
        src/crypto/hcrypto/Makefile \
-       src/des/Makefile \
-       src/des/test/Makefile \
        src/dir/Makefile \
        src/dir/test/Makefile \
        src/dviced/Makefile \
index 97e687d54cf5ae692f49c85cb1a93de1e90c25d1..fe8dd6c8d053d8d0930f42cc63712044c755131f 100644 (file)
@@ -166,13 +166,6 @@ rxgen: lwp
        $(NTMAKE)
        $(CD) ..\..
 
-des: rxgen
-     @echo ***** $@
-       $(DOCD) $(SRC)\des
-       $(CD) $(SRC)\des
-       $(NTMAKE)
-       $(CD) ..\..
-
 hcrypto: roken
      @echo ***** $@
        $(DOCD) $(SRC)\crypto\hcrypto
@@ -180,7 +173,7 @@ hcrypto: roken
        $(NTMAKE)
        $(CD) ..\..\..
 
-roken: des
+roken: rxgen
      @echo ***** $@
         $(DOCD) $(SRC)\roken
        $(CD) $(SRC)\roken
index ddc14c1227e0fbc70719174a6d72065160a67546..a97fd5d87ba07362d33d38759d099e335e2ac993 100644 (file)
@@ -139,8 +139,6 @@ src/config/Makefile.version-NOCML \
 src/config/shlib-build \
 src/config/shlib-install \
 src/crypto/hcrypto/Makefile \
-src/des/Makefile \
-src/des/test/Makefile \
 src/dir/Makefile \
 src/dir/test/Makefile \
 src/dviced/Makefile \
index 843fe8d2a0f1ca68efe1e1d44d362c35dd7b3330..d67637ebaa703abe8001224dd9971544625dc2de 100644 (file)
@@ -155,7 +155,6 @@ CLIENTADMINLIB = ${TOP_LIBDIR}/libclientadmin.a
 LIBJAFS_LIBS =\
        ${TOP_LIBDIR}/libjuafs.a \
        ${TOP_LIBDIR}/libafsutil.a \
-       ${TOP_LIBDIR}/libdes.a \
        -lresolv \
        -lpthread
 
index 20b4ad5c684ab4062de8ec191cae038d12606631..e24ffdad0508902644db38ee9948ed14944d69fd 100644 (file)
@@ -359,11 +359,11 @@ EXELIBS = \
        $(DESTDIR)\lib\afs\afsvldb.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afslwp.lib \
        $(DESTDIR)\lib\libosi.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 EXELIBS2 = \
@@ -375,15 +375,17 @@ EXELIBS2 = \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afslwp.lib \
        $(DESTDIR)\lib\libosi.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 EXELIBS3 = \
        $(DESTDIR)\lib\afs\afscmd.lib \
-       $(DESTDIR)\lib\afsrxkad.lib
+       $(DESTDIR)\lib\afsrxkad.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
+       $(DESTDIR)\lib\afsroken.lib
 
 
 # klog.exe
@@ -517,8 +519,9 @@ KPASSWD_LIBS =\
        $(DESTDIR)\lib\afsauthent.lib \
        $(DESTDIR)\lib\afsrpc.lib \
        $(DESTDIR)\lib\afs\afscmd.lib \
-       $(DESTDIR)\lib\afsdes.lib \
-       $(DESTDIR)\lib\afs\mtafsutil.lib
+       $(DESTDIR)\lib\afs\mtafsutil.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
+       $(DESTDIR)\lib\afsroken.lib
 
 $(OUT)\kpasswd.obj: $(KAUTH)/kpasswd.c
        $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
index 39b4cf0faadc0aa25cd72239be4251af6f01d4e2..0065a942179ba150db2068b1d492b0bec82f0716 100644 (file)
@@ -25,7 +25,7 @@
 #define KRB_DEFS
 
 /* Need some defs from des.h    */
-#include <des.h>
+#include <hcrypto/des.h>
 
 /* General definitions */
 #define                KSUCCESS        0
index 6c8372776fa3a4c2179257915f917144ac5a4310..1925d0ea38c3d414df2f6f3d2d3c742044fd6cda 100644 (file)
@@ -97,7 +97,6 @@ EXELIBS = \
        $(DESTDIR)\lib\afsauthent.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afsrxkad.lib \
-        $(DESTDIR)\lib\afsdes.lib \
         $(DESTDIR)\lib\afskfw.lib \
        $(DESTDIR)\lib\afs\AfsClass.lib \
        $(DESTDIR)\lib\afs\TaAfsAppLib.lib
index 65de6356f865fd2ae71ed4bd202889f9d742572a..8a6e9d386f4bbc4f3ac6663e543385affa6d6f24 100644 (file)
@@ -64,7 +64,6 @@ EXELIBS = \
        $(DESTDIR)\lib\afs\TaAfsAppLib.lib \
        $(DESTDIR)\lib\lanahelper.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsauthent.lib \
        $(DESTDIR)\lib\libafsconf.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
index 9cc1291e840095420b20e35d57e9b3f94361bfc0..6ca01005231950fb450528d3bce5bda5529884ec 100644 (file)
                     <Directory Id="dirInclude" Name="Include">
                         <Component Id="cmp_SDK_Include" Guid="2229E5F7-1D23-4088-AF85-917CCDB2634D">
                             <File Id="filebasic_H" Name="basic.h" LongName="basic.h" DiskId="1" src="$(var.IncDir)basic.h" /> 
-                            <File Id="filecrypt_H" Name="crypt.h" LongName="crypt.h" DiskId="1" src="$(var.IncDir)crypt.h" /> 
                             <File Id="filedbrpc_H" Name="dbrpc.h" LongName="dbrpc.h" DiskId="1" src="$(var.IncDir)dbrpc.h" /> 
-                            <File Id="filedes_H" Name="des.h" LongName="des.h" DiskId="1" src="$(var.IncDir)des.h" /> 
-                            <File Id="filedes_conf_H" Name="des_conf.h" LongName="des_conf.h" DiskId="1" src="$(var.IncDir)des_conf.h" /> 
-                            <File Id="filedes_odd_H" Name="des_odd.h" LongName="des_odd.h" DiskId="1" src="$(var.IncDir)des_odd.h" /> 
                             <File Id="filedirent_H" Name="dirent.h" LongName="dirent.h" DiskId="1" src="$(var.IncDir)dirent.h" />
                             <File Id="filelargeint_H" Name="largeint.h" LongName="largeint.h" DiskId="1" src="$(var.IncDir)largeint.h" /> 
                             <File Id="filelock_H" Name="lock.h" LongName="lock.h" DiskId="1" src="$(var.IncDir)lock.h" /> 
                             <File Id="filelwp_H" Name="lwp.h" LongName="lwp.h" DiskId="1" src="$(var.IncDir)lwp.h" /> 
                             <File Id="filemain_H" Name="main.h" LongName="main.h" DiskId="1" src="$(var.IncDir)main.h" /> 
-                            <File Id="filemit_cpyright_H" Name="MIT-CP~1.h" LongName="mit-cpyright.h" DiskId="1" src="$(var.IncDir)mit-cpyright.h" /> 
                             <File Id="fileosi_H" Name="osi.h" LongName="osi.h" DiskId="1" src="$(var.IncDir)osi.h" /> 
                             <File Id="fileosibasel_H" Name="osibasel.h" LongName="osibasel.h" DiskId="1" src="$(var.IncDir)osibasel.h" /> 
                             <File Id="fileosidb_H" Name="osidb.h" LongName="osidb.h" DiskId="1" src="$(var.IncDir)osidb.h" /> 
                             <Component Id="cmp_SDK_Include_rx" Guid="2E215D10-C080-42A3-B692-AFF94C7A1A2B">
                                 <File Id="fileasn1_err_H" Name="asn1_err.h" LongName="asn1_err.h" DiskId="1" src="$(var.IncDir)rx\asn1_err.h" /> 
                                 <File Id="filefcrypt_H" Name="fcrypt.h" LongName="fcrypt.h" DiskId="1" src="$(var.IncDir)rx\fcrypt.h" /> 
-                                <File Id="filehash_H" Name="hash.h" LongName="hash.h" DiskId="1" src="$(var.IncDir)rx\hash.h" /> 
-                                <File Id="filemd4_H" Name="md4.h" LongName="md4.h" DiskId="1" src="$(var.IncDir)rx\md4.h" /> 
-                                <File Id="filemd5_H" Name="md5.h" LongName="md5.h" DiskId="1" src="$(var.IncDir)rx\md5.h" /> 
                                 <File Id="filerx_H" Name="rx.h" LongName="rx.h" DiskId="1" src="$(var.IncDir)rx\rx.h" /> 
                                 <File Id="filerxkad_H" Name="rxkad.h" LongName="rxkad.h" DiskId="1" src="$(var.IncDir)rx\rxkad.h" /> 
                                 <File Id="filerxkad_prototypes_H" Name="RXKAD_~1.h" LongName="rxkad_prototypes.h" DiskId="1" src="$(var.IncDir)rx\rxkad_prototypes.h" /> 
                     <Directory Id="dirLib" Name="lib">
                         <Component Win64="$(var.Win64)" Id="cmp_SDK_Lib" Guid="$(var.cmp_SDK_Lib_guid)">
                             <File Id="fileafsauthent_LIB" Name="AFSAUT~1.lib" LongName="afsauthent.lib" DiskId="1" src="$(var.LibDir)afsauthent.lib" /> 
-                            <File Id="fileafsdes_LIB" Name="afsdes.lib" LongName="afsdes.lib" DiskId="1" src="$(var.LibDir)afsdes.lib" /> 
                             <File Id="fileafskfw_LIB" Name="afskfw.lib" LongName="afskfw.lib" DiskId="1" src="$(var.LibDir)afskfw.lib" /> 
                             <File Id="fileafslogon_LIB" Name="afslogon.lib" LongName="afslogon.lib" DiskId="1" src="$(var.LibDir)afslogon.lib" /> 
                             <File Id="fileafslwp_LIB" Name="afslwp.lib" LongName="afslwp.lib" DiskId="1" src="$(var.LibDir)afslwp.lib" /> 
index 1d22402848b50a8d8b35d73218ff3255c9af64f6..aec07b7276e65cbb1a235ff8ce6512a998a6217b 100644 (file)
@@ -25,7 +25,7 @@ all: afsd vsys @ENABLE_FUSE_CLIENT@
 #
 
 AFSLIBS=${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a
-UAFSLIBS=${TOP_LIBDIR}/libuafs.a ${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/libafsutil.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libafsutil.a
+UAFSLIBS=${TOP_LIBDIR}/libuafs.a ${TOP_LIBDIR}/libafsutil.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libafsutil.a
 
 FUSE_LIBS=@FUSE_LIBS@
 
index 2ed130c31aa39e7e870b4b7a6481841b80859e54..6876a09aa687b36363c8fd948f6b8f06f352ceae 100644 (file)
@@ -17,7 +17,7 @@ AFSLIBS = ${TOP_LIBDIR}/libprot.a ${TOP_LIBDIR}/libauth.a \
          ${TOP_LIBDIR}/libubik.a ${TOP_LIBDIR}/librxkad.a \
          ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a \
          ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/liblwp.a \
-         ${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/libcom_err.a \
+         ${TOP_LIBDIR}/libafshcrypto_lwp.a ${TOP_LIBDIR}/libcom_err.a \
          ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libafsutil.a
 
 SRCS=  aklog.c krb_util.c linked_list.c
index d3b936036cda8998ffbf525fe82c1b208b5acf54..77c2141890fddf776d337f5e82da57bdf51ac5dd 100644 (file)
@@ -20,9 +20,12 @@ KOBJS= cellconfig.o ktc.krb.o userok.o writeconfig.o authcon.o \
     acfg_errors.o ktc_errors.o token.xdr.o token.o
 
 LIBS=libauth.a \
-      ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a \
-      ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/libsys.a \
-      ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a
+      ${TOP_LIBDIR}/librxkad.a \
+      ${TOP_LIBDIR}/librx.a \
+      ${TOP_LIBDIR}/libsys.a \
+      ${TOP_LIBDIR}/liblwp.a \
+      ${TOP_LIBDIR}/util.a
+
 INCLS=cellconfig.h auth.h keys.h
 KSRCS=auth.h
 UKSRCS=${KSRCS} cellconfig.h acfg_errors.c keys.h cellconfig.c \
index df3d8f3ec2a4b7e0d38d02507c11548b2a8f0fce..46efcbe86cbd5c45b22119ac8ca675d7a50c4539 100644 (file)
@@ -87,13 +87,13 @@ EXELIBDIR = $(DESTDIR)\lib
 EXELIBS =\
        $(EXELIBDIR)\afs\afsauth.lib \
        $(EXELIBDIR)\afsrxkad.lib \
-       $(EXELIBDIR)\afsdes.lib \
        $(EXELIBDIR)\afsrx.lib \
        $(EXELIBDIR)\afslwp.lib \
        $(EXELIBDIR)\afs\afsutil.lib \
        $(EXELIBDIR)\afs\afseventlog.lib \
        $(EXELIBDIR)\afs\afsreg.lib \
        $(EXELIBDIR)\libafsconf.lib \
+       $(EXELIBDIR)\afshcrypto.lib \
        $(EXELIBDIR)\afsroken.lib
 
 $(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
index 60722e6ade8256b5d76e09a27344aa75ee8a349a..e1ee955247ef47113aaceb001fa25b6e35cd265e 100644 (file)
 
 #include <roken.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#endif
+
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #include <sys/types.h>
 #endif
 #include <string.h>
 #include <stdio.h>
-#include <des.h>
-#include <des_prototypes.h>
+
+#define HC_DEPRECATED
+#include <hcrypto/des.h>
+
 #include <rx/rxkad.h>
 #include <rx/rx.h>
+
 #include "cellconfig.h"
 #include "keys.h"
 #include "ktc.h"
@@ -90,8 +97,8 @@ GenericAuth(struct afsconf_dir *adir,
     }
 
     /* next create random session key, using key for seed to good random */
-    des_init_random_number_generator(ktc_to_cblock(&key));
-    code = des_random_key(ktc_to_cblock(&session));
+    DES_init_random_number_generator((DES_cblock *) &key);
+    code = DES_new_random_key((DES_cblock *) &session);
     if (code) {
        return QuickAuth(astr, aindex);
     }
index 942d10ea097f19b3f97081ce20d32bc4c63d7b38..8c7ad1184545206521b04866b2725a3e3fe439ad 100644 (file)
@@ -25,7 +25,7 @@ INCLS=bnode.h \
        ${TOP_INCDIR}/afs/ktime.h
 
 # EH 12/18/90 - have to search librx.a twice on Ultrix 4.0
-LIBS=${TOP_LIBDIR}/librx.a \
+LIBS=   ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libkauth.a \
@@ -34,13 +34,13 @@ LIBS=${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxstat.a \
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/util.a \
        ${TOP_LIBDIR}/libsys.a \
-       ${TOP_LIBDIR}/libprocmgmt.a
+       ${TOP_LIBDIR}/libprocmgmt.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
 
 OBJS=bosserver.o bnode.o ezbnodeops.o fsbnodeops.o bosint.ss.o bosint.xdr.o \
 bosoprocs.o cronbnodeops.o
@@ -97,12 +97,12 @@ bosoprocs.o: bosoprocs.c ${INCLS}
 bos.o: bos.c ${INCLS} AFS_component_version_number.o
 
 bos: bos.o $(LIBS) libbos.a
-       $(AFS_LDRULE) bos.o libbos.a $(LIBS) $(LIB_roken) ${XLIBS}
+       $(AFS_LDRULE) bos.o libbos.a $(LIBS) $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 bos_util.o: bos_util.c ${INCLS} AFS_component_version_number.o ${TOP_INCDIR}/afs/bnode.h
 
 bos_util: bos_util.o  $(LIBS)
-       $(AFS_LDRULE) bos_util.o $(LIBS) $(LIB_roken) ${XLIBS}
+       $(AFS_LDRULE) bos_util.o $(LIBS) $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 ezbnodeops.o: ezbnodeops.c ${INCLS}
 
@@ -115,7 +115,7 @@ libbos.a: bosint.xdr.o bosint.cs.o boserr.o AFS_component_version_number.o
 
 bosserver: $(OBJS) $(LIBS)
        $(AFS_LDRULE) $(OBJS) ${TOP_LIBDIR}/libaudit.a \
-               $(LIBS) $(LIB_roken) ${XLIBS}
+               $(LIBS) $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 #
 # Install targets
index 61b67640b03dcd50fe8bbded0a50416da6307baf..01df04cea060c531dc5e432e6520145966efcdf6 100644 (file)
@@ -57,7 +57,6 @@ BOSSERVER_EXELIBS =\
        $(DESTDIR)\lib\afs\afsauth.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
        $(DESTDIR)\lib\afsrxstat.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afs\afscom_err.lib \
@@ -69,6 +68,7 @@ BOSSERVER_EXELIBS =\
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(BOSSERVER_EXEFILE): $(BOSSERVER_EXEOBJS) $(BOSSERVER_EXELIBS)
@@ -97,7 +97,6 @@ BOS_EXELIBS =\
        $(DESTDIR)\lib\afs\afsvldb.lib \
        $(DESTDIR)\lib\afs\afsauth.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afs\afscom_err.lib \
@@ -107,6 +106,7 @@ BOS_EXELIBS =\
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\afs\afspioctl.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 
index 527ac75c6aa9ffdf5044f96bcf84f65f79a735ef..7545b2d97eb048526f527be94e0189537779a8c6 100644 (file)
@@ -45,8 +45,7 @@
 #include <afs/com_err.h>
 #include <ubik.h>
 #include <afs/ktime.h>
-#include <des.h>
-#include <des_prototypes.h>
+#include <hcrypto/ui.h>
 #include <afs/kautils.h>
 #include <afs/volser.h>
 
@@ -816,12 +815,12 @@ AddKey(struct cmd_syndesc *as, void *arock)
        strcpy(buf, as->parms[1].items->data);
     else {
        /* prompt for key */
-       code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0);
+       code = UI_UTIL_read_pw_string(buf, sizeof(buf), "input key: ", 0);
        if (code || strlen(buf) == 0) {
            fprintf(stderr, "Bad key: \n");
            exit(1);
        }
-       code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
+       code = UI_UTIL_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
        if (code || strlen(ver) == 0) {
            fprintf(stderr, "Bad key: \n");
            exit(1);
index 5847ab00865075dd460ce2d410255b44bdbfa661..e3795e536824b14fc08824c2be048fd9f5a4f26d 100644 (file)
 
 #include <afs/stds.h>
 #include <afs/afsutil.h>
-#include <rx/rxkad.h>
 #include <afs/keys.h>
 #include <afs/cellconfig.h>
 #include <afs/kautils.h>
-#include <des.h>
-#include <des_prototypes.h>
+#include <hcrypto/ui.h>
+#include <hcrypto/des.h>
 
 int
 main(int argc, char **argv)
@@ -76,12 +75,12 @@ main(int argc, char **argv)
        memset(&tkey, 0, sizeof(struct ktc_encryptionKey));
 
        /* prompt for key */
-       code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0);
+       code = UI_UTIL_read_pw_string(buf, sizeof(buf), "input key: ", 0);
        if (code || strlen(buf) == 0) {
            printf("Bad key: \n");
            exit(1);
        }
-       code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
+       code = UI_UTIL_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
        if (code || strlen(ver) == 0) {
            printf("Bad key: \n");
            exit(1);
@@ -97,7 +96,7 @@ main(int argc, char **argv)
            exit(1);
        }
     } else if (strcmp(argv[1], "adddes") == 0) {
-       struct ktc_encryptionKey tkey;
+       DES_cblock tkey;
        int kvno;
        afs_int32 code;
        char buf[BUFSIZ], ver[BUFSIZ];
@@ -110,12 +109,12 @@ main(int argc, char **argv)
        memset(&tkey, 0, sizeof(struct ktc_encryptionKey));
 
        /* prompt for key */
-       code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0);
+       code = UI_UTIL_read_pw_string(buf, sizeof(buf), "input key: ", 0);
        if (code || strlen(buf) == 0) {
            printf("Bad key: \n");
            exit(1);
        }
-       code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
+       code = UI_UTIL_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
        if (code || strlen(ver) == 0) {
            printf("Bad key: \n");
            exit(1);
@@ -124,8 +123,8 @@ main(int argc, char **argv)
            printf("\nInput key mismatch\n");
            exit(1);
        }
-       des_string_to_key(buf, ktc_to_cblockptr(&tkey));
-       code = afsconf_AddKey(tdir, kvno, ktc_to_charptr(&tkey), 0);
+       DES_string_to_key(buf, &tkey);
+       code = afsconf_AddKey(tdir, kvno, (char *) &tkey, 0);
        if (code) {
            printf("bos_util: failed to set key, code %d.\n", code);
            exit(1);
index f8763187ec40412ef98c7b7984a5a0a21d82f091..c21d37dbe89a663494658ff3471d954c6df7a1b2 100644 (file)
@@ -29,7 +29,6 @@
 #include <afs/cellconfig.h>
 #include <afs/keys.h>
 #include <sys/stat.h>
-#include <des.h>
 #include <dirent.h>
 #include <stdio.h>
 #ifdef HAVE_STDINT_H
index 192b0b18bf6e120cfd22f7c14a5b16705b1a4195..029335dc2dd3ad92bdbb3de2c5211276bd9195a5 100644 (file)
@@ -19,10 +19,12 @@ LIBS=${TOP_LIBDIR}/libbudb.a ${TOP_LIBDIR}/libbubasics.a \
         ${TOP_LIBDIR}/libvldb.a  ${TOP_LIBDIR}/vlib.a \
         ${TOP_LIBDIR}/libkauth.a ${TOP_LIBDIR}/libubik.a \
         ${TOP_LIBDIR}/libauth.a  ${TOP_LIBDIR}/librxkad.a \
-        ${TOP_LIBDIR}/libsys.a   ${TOP_LIBDIR}/libdes.a \
+        ${TOP_LIBDIR}/libsys.a \
         ${TOP_LIBDIR}/librx.a  ${TOP_LIBDIR}/libsys.a \
         ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
-        ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
+        ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
+       ${TOP_LIBDIR}/util.a
 
 all: ${TOP_LIBDIR}/libbxdb.a ${TOP_INCDIR}/afs/bucoord_prototypes.h ${TOP_INCDIR}/afs/bc.h backup
 
index c9919cb900f3648fa961880a3c770692fb8fafa1..4c6a76c4ab7eb7ffae82c9b25ec887cef4068d87 100644 (file)
@@ -81,7 +81,6 @@ EXELIBS =\
         $(DESTDIR)\lib\afsubik.lib \
         $(DESTDIR)\lib\afs\afsauth.lib \
         $(DESTDIR)\lib\afsrxkad.lib \
-        $(DESTDIR)\lib\afsdes.lib \
         $(DESTDIR)\lib\afsrx.lib \
         $(DESTDIR)\lib\afslwp.lib \
         $(DESTDIR)\lib\afs\afscmd.lib \
@@ -92,6 +91,7 @@ EXELIBS =\
        $(DESTDIR)\lib\afs\afspioctl.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
        
 
index d0949051264abb14023ced6d511f2bf5181729eb..d0fd89c5324287d607cad8a220f1fa49feffb3ef 100644 (file)
@@ -19,7 +19,6 @@ INCLS=\
        ${TOP_INCDIR}/lock.h \
        ${TOP_INCDIR}/ubik.h \
        ${TOP_INCDIR}/lwp.h \
-       ${TOP_INCDIR}/des.h \
        ${TOP_INCDIR}/rx/rx.h \
        ${TOP_INCDIR}/rx/xdr.h \
        ${TOP_INCDIR}/rx/rxkad.h \
@@ -38,12 +37,12 @@ LIBS=${TOP_LIBDIR}/libbubasics.a \
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
        ${TOP_LIBDIR}/libsys.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libsys.a \
        ${TOP_LIBDIR}/liblwp.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/util.a
 
 COMMON_OBJS = database.o db_alloc.o db_dump.o db_hash.o struct_ops.o ol_verify.o
index 7b103b621e48702678de23b4aed437df4bd3ad19..2299d2b564ad0ea923679511fcf388849baa5971 100644 (file)
@@ -68,7 +68,6 @@ EXELIBS =\
         $(DESTDIR)\lib\afslwp.lib \
         $(DESTDIR)\lib\afs\afscom_err.lib \
        $(DESTDIR)\lib\afs\afsaudit.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
        $(DESTDIR)\lib\afs\afskauth.lib \
        $(DESTDIR)\lib\afs\afsauth.lib \
@@ -80,6 +79,7 @@ EXELIBS =\
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(EXEFILE): $(EXEOBJS)  $(EXELIBS)
index cf828ae26e3a07df9323141dc9d8723944c6da94..17db2bd1c950d02795ddf7c4b336f41ed68aa5cb 100644 (file)
@@ -36,7 +36,6 @@
 #include <rx/rx.h>
 #include <rx/rxkad.h>
 #include <string.h>
-#include <des.h>
 #include <afs/cellconfig.h>
 #include <errno.h>
 #include "budb.h"
index 1d654356dec0ec0fe59d9fa47956fc48bb14522a..75b14a82368f3d017bff43255f863d47895c2ab7 100644 (file)
@@ -39,7 +39,6 @@
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
-#include <des.h>
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <errno.h>
index 627af86504927ae53024811ada628399000ce889..574f3a8187fa75d57e81fee52be2f616bfad7408 100644 (file)
@@ -40,12 +40,12 @@ LIBS=${TOP_LIBDIR}/libbudb.a \
         ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
         ${TOP_LIBDIR}/libsys.a  \
-        ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/librx.a \
         ${TOP_LIBDIR}/libsys.a  \
        ${TOP_LIBDIR}/liblwp.a \
         ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/libusd.a \
        ${TOP_LIBDIR}/util.a \
        ${TOP_LIBDIR}/libprocmgmt.a
index 6f65a81390f594328ec7f3e417628d8b4521af3b..8a4c9d3555e851ab82f8632f6fdbbd584066fdd7 100644 (file)
@@ -42,7 +42,6 @@ EXELIBS =\
         $(DESTDIR)\lib\afsubik.lib \
         $(DESTDIR)\lib\afs\afsauth.lib \
         $(DESTDIR)\lib\afsrxkad.lib \
-        $(DESTDIR)\lib\afsdes.lib \
         $(DESTDIR)\lib\afsrx.lib \
         $(DESTDIR)\lib\afslwp.lib \
         $(DESTDIR)\lib\afs\afscmd.lib \
@@ -54,6 +53,7 @@ EXELIBS =\
        $(DESTDIR)\lib\afs\afseventlog.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(EXERES): butc.rc AFS_component_version_number.h
index 0cd76ba49ec4a054581364e6776b0013891b6610..58e2b1a98b2e0d54d02b2626b781959d15308f0e 100644 (file)
@@ -88,12 +88,6 @@ idirs: doclink
 !      IF (!EXIST($(OJT)\crypto\hcrypto))
                $(MKDIR) $(OJT)\crypto\hcrypto
 !      ENDIF
-!      IF (!EXIST($(OJT)\des))
-               $(MKDIR) $(OJT)\des
-!      ENDIF
-!      IF (!EXIST($(OJT)\des\test))
-               $(MKDIR) $(OJT)\des\test
-!      ENDIF
 !      IF (!EXIST($(OJT)\dir))
                $(MKDIR) $(OJT)\dir
 !      ENDIF
@@ -424,9 +418,6 @@ idirs: doclink
 !      IF (!EXIST($(DESTDIR)\include\afs))
                $(MKDIR) $(DESTDIR)\include\afs
 !      ENDIF
-!      IF (!EXIST($(DESTDIR)\include\des))
-               $(MKDIR) $(DESTDIR)\include\des
-!      ENDIF
 !      IF (!EXIST($(DESTDIR)\include\hcrypto))
                $(MKDIR) $(DESTDIR)\include\hcrypto
 !      ENDIF
index ed4c921f8df2d8d501d3fc958f0db47ea8b1e0c7..00df6ba6e45ab8278518abf27b370272ba1f7838 100644 (file)
@@ -15,3 +15,5 @@ EXPORTS
        hc_MD5_Init                             @14
        hc_MD5_Update                           @15
        hc_UI_UTIL_read_pw_string               @16
+       hc_DES_is_weak_key                      @17
+       hc_DES_check_key_parity                 @18
diff --git a/src/des/.gitignore b/src/des/.gitignore
deleted file mode 100644 (file)
index 95d09ab..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# After changing this file, please run
-#     git ls-files -i --exclude-standard
-# to check that you haven't inadvertently ignored any tracked files.
-
-/fp.c
-/ip.c
-/key_perm.h
-/make_fp
-/make_ip
-/make_keyperm
-/make_odd
-/make_p
-/make_p_table
-/make_s_table
-/odd.h
-/p.c
-/p_table.h
-/s_table.h
-/s.c
diff --git a/src/des/Makefile.in b/src/des/Makefile.in
deleted file mode 100644 (file)
index 0d1aa82..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-#
-# Copyright 1987 by the Massachusetts Institute of Technology.
-#
-# For copying and distribution information,
-# please see the file <mit-cpyright.h>.
-#
-# Makefile for BSD DES library
-#
-# First define machine type, compiler, and object file suffix
-# Could be for VAX or PC-DOS
-#
-# Some of these files are cross compiled on the vax for the pc8086,
-# using the MIT LCS cross-compilation environment
-# Others are always executed on the vax(host).
-#
-# A machine, e.g. Vax, pc8086, IBM experimental workstation, is 
-# described in terms of defines for its word length
-# (BITS32 or BITS16), byte ordering (LSBFIRST or MSBFIRST) and 
-# operating system (BSDUNIX or CROSSMSDOS).
-#
-# Make sure these are properly defined for any new machine types.
-# target machine for run-time code (may cross-compile),
-# override as needed 
-
-srcdir=@srcdir@
-include @TOP_OBJDIR@/src/config/Makefile.config
-include @TOP_OBJDIR@/src/config/Makefile.lwp
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-
-OBJS = \
-       des.o \
-       cbc_encrypt.o \
-       pcbc_encrypt.o \
-       cksum.o \
-       new_rnd_key.o \
-       key_sched.o \
-       debug_decl.o \
-       quad_cksum.o \
-       key_parity.o \
-       weak_key.o \
-       read_pssword.o \
-       strng_to_key.o \
-       misc.o \
-       crypt.o \
-       util.o
-
-all: \
-       ${TOP_LIBDIR}/libdes.a \
-       ${TOP_INCDIR}/des.h \
-       ${TOP_INCDIR}/des_prototypes.h \
-       ${TOP_INCDIR}/des_conf.h \
-       ${TOP_INCDIR}/mit-cpyright.h \
-       ${TOP_INCDIR}/des_odd.h
-
-buildtools: \
-       make_p \
-       make_keyperm \
-       make_s_table \
-       make_p_table \
-       make_ip \
-       make_fp \
-       make_odd \
-       ${TOP_INCDIR}/des.h \
-       ${TOP_INCDIR}/mit-cpyright.h \
-
-generated: \
-       p.c \
-       key_perm.h \
-       s_table.h \
-       p_table.h \
-       ip.c \
-       fp.c \
-       odd.h
-
-${TOP_LIBDIR}/libdes.a: libdes.a
-       ${INSTALL_DATA} $? $@
-
-${TOP_INCDIR}/des.h: des.h
-       ${INSTALL_DATA} $? $@
-
-${TOP_INCDIR}/des_prototypes.h: des_prototypes.h
-       ${INSTALL_DATA} $? $@
-
-${TOP_INCDIR}/des_conf.h: des_conf.h
-       ${INSTALL_DATA} $? $@
-
-${TOP_INCDIR}/mit-cpyright.h: mit-cpyright.h
-       ${INSTALL_DATA} $? $@
-
-${TOP_INCDIR}/des_odd.h: odd.h
-       ${INSTALL_DATA} $? $@
-
-#
-# Build rules
-#
-libdes.a: ${OBJS} AFS_component_version_number.o
-       $(RM) -f libdes.a
-       $(AR) crv libdes.a ${OBJS} AFS_component_version_number.o
-       $(RANLIB) libdes.a
-
-make_ip: make_ip.o misc.o main.o
-       $(AFS_LDRULE) make_ip.o misc.o main.o
-
-make_fp: make_fp.o misc.o main.o
-       $(AFS_LDRULE) make_fp.o misc.o main.o
-
-make_odd: make_odd.o misc.o main.o
-       $(AFS_LDRULE) make_odd.o misc.o main.o
-
-make_s_table: make_s_table.o misc.o main.o 
-       $(AFS_LDRULE) make_s_table.o misc.o main.o
-
-make_p_table: make_p_table.o misc.o main.o 
-       $(AFS_LDRULE) make_p_table.o misc.o main.o
-
-make_keyperm: make_keyperm.o misc.o main.o 
-       $(AFS_LDRULE) make_keyperm.o misc.o main.o
-
-make_e:        make_e.o misc.o main.o 
-       $(AFS_LDRULE) make_e.o misc.o main.o
-
-make_p:        make_p.o misc.o main.o 
-       $(AFS_LDRULE) make_p.o misc.o main.o
-
-make_s:        make_s.o misc.o main.o 
-       $(AFS_LDRULE) make_s.o misc.o main.o
-
-crypt.o: ${srcdir}/crypt.c
-       case ${SYS_NAME} in \
-       rs_aix*)\
-               ${CCOBJ} -c ${COMMON_INCL} -o crypt.o ${srcdir}/crypt.c ;;\
-       *)\
-               $(AFS_CCRULE) ${srcdir}/crypt.c ;;\
-       esac
-#
-# Table/code generation targets
-#
-odd.h: make_odd
-       ./make_odd odd.h
-
-s_table.h: make_s_table
-       ./make_s_table s_table.h
-
-p_table.h: make_p_table
-       ./make_p_table p_table.h
-
-key_perm.h: make_keyperm
-       ./make_keyperm key_perm.h
-
-ip.c: make_ip
-       ./make_ip ip.c
-
-p.c: make_p
-       ./make_p p.c
-
-s.c: make_s
-       ./make_s s.c
-
-fp.c: make_fp
-       ./make_fp fp.c
-
-#
-# Dependency rules
-#
-INCLS=des.h des_prototypes.h mit-cpyright.h des_conf.h des_internal.h conf.h
-
-make_keyperm.o: make_keyperm.c ${INCLS}
-make_ip.o: make_ip.c tables.h ${INCLS}
-make_fp.o: make_fp.c tables.h ${INCLS}
-make_p.o: make_p.c tables.h ${INCLS}
-make_s.o: make_s.c s_table.h ${INCLS}
-make_s_table.o: make_s_table.c tables.h ${INCLS}
-make_p_table.o: make_p_table.c tables.h ${INCLS}
-make_odd.o: make_odd.c ${INCLS}
-misc.o: misc.c AFS_component_version_number.c ${INCLS}
-main.o: main.c AFS_component_version_number.c ${INCLS}
-key_sched.o: key_sched.c key_perm.h odd.h ${INCLS}
-key_test.o: key_test.c ${INCLS}
-testit.o: testit.c ${INCLS}
-des.o: s_table.h p_table.h ip.c p.c fp.c ${INCLS}
-cbc_encrypt.o: cbc_encrypt.c ${INCLS}
-verify.o: verify.c ${INCLS}
-read_pssword.o: read_pssword.c ${INCLS}
-pcbc_encrypt.o: pcbc_encrypt.c ${INCLS}
-cksum.o: cksum.c ${INCLS}
-quad_cksum.o: quad_cksum.c ${INCLS}
-key_parity.o: key_parity.c odd.h ${INCLS}
-weak_key.o: weak_key.c ${INCLS}
-new_rnd_key.o: new_rnd_key.c ${INCLS}
-util.o: util.c ${INCLS}
-strng_to_key.o: strng_to_key.c ${INCLS}
-debug_decl.o: debug_decl.c ${INCLS}
-make_e.o: make_e.c ${INCLS}
-
-#
-# Install targets
-#
-install: libdes.a des.h des_prototypes.h des_conf.h mit-cpyright.h odd.h
-       ${INSTALL} -d ${DESTDIR}${libdir}
-       ${INSTALL} -d ${DESTDIR}${includedir}
-       ${INSTALL_DATA} libdes.a ${DESTDIR}${libdir}/libdes.a
-       ${INSTALL_DATA} ${srcdir}/des.h ${DESTDIR}${includedir}/des.h
-       ${INSTALL_DATA} ${srcdir}/des_prototypes.h ${DESTDIR}${includedir}/des_prototypes.h
-       ${INSTALL_DATA} ${srcdir}/des_conf.h ${DESTDIR}${includedir}/des_conf.h
-       ${INSTALL_DATA} ${srcdir}/mit-cpyright.h ${DESTDIR}${includedir}/mit-cpyright.h
-       ${INSTALL_DATA} odd.h ${DESTDIR}${includedir}/des_odd.h
-
-dest: libdes.a des.h des_prototypes.h des_conf.h mit-cpyright.h odd.h
-       ${INSTALL} -d ${DEST}/lib
-       ${INSTALL} -d ${DEST}/include
-       ${INSTALL_DATA} libdes.a ${DEST}/lib/libdes.a
-       ${INSTALL_DATA} ${srcdir}/des.h ${DEST}/include/des.h
-       ${INSTALL_DATA} ${srcdir}/des_prototypes.h ${DEST}/include/des_prototypes.h
-       ${INSTALL_DATA} ${srcdir}/des_conf.h ${DEST}/include/des_conf.h
-       ${INSTALL_DATA} ${srcdir}/mit-cpyright.h ${DEST}/include/mit-cpyright.h
-       ${INSTALL_DATA} odd.h ${DEST}/include/des_odd.h
-
-#
-# Misc. targets
-#
-test: libdes.a
-       cd test; $(MAKE)
-
-clean:
-       $(RM) -f *.a *.s *.o *.b core *~ *.com *.ld
-       $(RM) -f make_fp make_ip make_keyperm make_odd make_p \
-               make_p_table make_s_table key_perm.h p_table.h \
-               s_table.h odd.h p.c s.c fp.c ip.c AFS_component_version_number.c
-       cd test; $(MAKE) clean
-
-include ../config/Makefile.version
diff --git a/src/des/NTMakefile b/src/des/NTMakefile
deleted file mode 100644 (file)
index 93cba99..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-#
-# Copyright 1987 by the Massachusetts Institute of Technology.
-#
-# For copying and distribution information,
-# please see the file <mit-cpyright.h>.
-#
-# Makefile for BSD DES library
-#
-# First define machine type, compiler, and object file suffix
-# Could be for VAX or PC-DOS
-#
-# Some of these files are cross compiled on the vax for the pc8086,
-# using the MIT LCS cross-compilation environment
-# Others are always executed on the vax(host).
-#
-# A machine, e.g. Vax, pc8086, IBM experimental workstation, is 
-# described in terms of defines for its word length
-# (BITS32 or BITS16), byte ordering (LSBFIRST or MSBFIRST) and 
-# operating system (BSDUNIX or CROSSMSDOS).
-#
-# Make sure these are properly defined for any new machine types.
-# target machine for run-time code (may cross-compile),
-# override as needed 
-#
-
-RELDIR=des
-!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
-
-INCFILEDIR = $(DESTDIR)\include
-
-INCFILES =\
-       $(INCFILEDIR)\des.h \
-       $(INCFILEDIR)\des_conf.h \
-        $(INCFILEDIR)\des_prototypes.h \
-       $(INCFILEDIR)\mit-cpyright.h \
-       $(INCFILEDIR)\des_odd.h \
-       $(INCFILEDIR)\crypt.h
-
-$(INCFILEDIR)\des_odd.h: odd.h
-       $(COPY) odd.h $@
-
-# Library component lists.
-
-LIBOBJS = \
-       $(OUT)\des.obj \
-       $(OUT)\cbc_encrypt.obj \
-       $(OUT)\pcbc_encrypt.obj \
-       $(OUT)\cksum.obj \
-       $(OUT)\new_rnd_key.obj \
-       $(OUT)\key_sched.obj \
-       $(OUT)\debug_decl.obj \
-       $(OUT)\quad_cksum.obj \
-       $(OUT)\key_parity.obj \
-       $(OUT)\weak_key.obj \
-       $(OUT)\read_pssword.obj \
-       $(OUT)\strng_to_key.obj \
-       $(OUT)\misc.obj \
-       $(OUT)\util.obj \
-       $(OUT)\crypt.obj
-
-$(LIBOBJS): $$(@B).c
-    $(C2OBJ) $**
-
-LIBFILE = $(DESTDIR)\lib\afsdes.lib
-
-$(LIBFILE): $(LIBOBJS)
-       $(LIBARCH)
-
-#####################
-# Generator Files ###
-#####################
-
-GENERATED_FILES = \
-    $(VERSFILE).c \
-       key_perm.h \
-       p_table.h \
-       s_table.h \
-       odd.h \
-       p.c \
-       s.c \
-       fp.c \
-       ip.c
-
-# Make generated files.
-MAKETARG = $** $@
-
-key_perm.h: $(OUT)\make_keyperm.exe
-       $(MAKETARG)
-
-p_table.h: $(OUT)\make_p_table.exe
-       $(MAKETARG)
-
-s_table.h: $(OUT)\make_s_table.exe
-       $(MAKETARG)
-
-odd.h: $(OUT)\make_odd.exe
-       $(MAKETARG)
-
-p.c: $(OUT)\make_p.exe
-       $(MAKETARG)
-
-s.c: $(OUT)\make_s.exe
-       $(MAKETARG)
-
-fp.c: $(OUT)\make_fp.exe
-       $(MAKETARG)
-
-ip.c: $(OUT)\make_ip.exe
-       $(MAKETARG)
-
-# Make generators.
-$(OUT)\main.obj: main.c
-    $(C2OBJ) $**
-
-$(OUT)\make_keyperm.exe: $(OUT)\make_keyperm.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_p_table.exe: $(OUT)\make_p_table.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_s_table.exe: $(OUT)\make_s_table.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_odd.exe: $(OUT)\make_odd.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_p.exe: $(OUT)\make_p.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_s.exe: $(OUT)\make_s.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_fp.exe: $(OUT)\make_fp.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-$(OUT)\make_ip.exe: $(OUT)\make_ip.obj $(OUT)\misc.obj $(OUT)\main.obj
-       $(EXECONLINK)
-       $(_VC_MANIFEST_EMBED_EXE)
-        $(CODESIGN_USERLAND)
-        $(SYMSTORE_IMPORT)
-
-GENOBJS = $(OUT)\make_keyperm.obj \
-    $(OUT)\make_p_table.obj \
-    $(OUT)\make_s_table.obj \
-    $(OUT)\make_odd.obj \
-    $(OUT)\make_p.obj \
-    $(OUT)\make_s.obj \
-    $(OUT)\make_fp.obj \
-    $(OUT)\make_ip.obj
-    
-$(GENOBJS): $$(@B).c
-    $(C2OBJ) $**
-
-install: $(GENERATED_FILES) $(LIBFILE) $(INCFILES)
-
-install9x: install
-
-clean::
-       $(DEL) $(LIBFILE) $(GENERATED_FILES)
-
-mkdir:
-
diff --git a/src/des/READ_ME b/src/des/READ_ME
deleted file mode 100644 (file)
index 0228da4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-This directory contains the sources for the DES encryption library and
-test programs.  
-
-Two precautions-- 
-
-1)  under US law, DES software and hardware may not be
-       exported without license from the US Dept of Commerce.
-
-2)     The only way to get a significant speedup of the algorithm is to
-       use considerably more space, traded against time. Dont play
-       with the code -- there is a high probability you will either
-       make it slower, or wrong, or both.  This implementation was
-       optimized for the UVAX 2.  Other architectures could benefit from
-       some "asm" tweaking.
-
-3)     If you do play with the code, make sure that the test program
-       "verify" still yields the expected answers.  Otherwise, your
-       ciphertext will not decrypt under a standard implementation, such
-       as on the VLSI chips that have been certified.
-
-       Project Athena          Steve Miller                            3/86 
diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h
deleted file mode 100644 (file)
index 3469e2b..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Andrew configuration.
- */
-
-#ifdef vax
-#include "conf-bsdvax.h"
-#else
-#if mips && !defined(sgi)
-#include "conf-mips.h"
-#else
-#if    defined(sun) && !defined(AFS_X86_ENV)
-#include "conf-bsd-sun.h"
-#else
-#ifdef AFS_AIX_ENV
-#include "conf-aix-ibm.h"
-#else
-#ifdef mac2
-#include "conf-bsd-mac.h"
-#else
-#ifdef AFS_HPUX_ENV
-#ifdef hp9000s300
-#include "conf-hp9000s300.h"
-#else
-#include "conf-hp9000s700.h"
-#endif
-#else
-#ifdef NeXT
-#include "conf-next.h"
-#else
-#if defined(sgi)
-#include "conf-sgi.h"
-#else
-#ifdef AFS_OSF_ENV
-#if defined(__alpha)
-#include "conf-bsd-alpha.h"
-#else
-#error unknown osf
-#endif
-#else
-#if    defined(AFS_X86_ENV) && !defined(AFS_DARWIN_ENV)
-#include "conf-bsd-ncr.h"
-#else
-#ifdef AFS_NT40_ENV
-#include "conf-winnt.h"
-#else
-
-#ifdef AFS_XBSD_ENV
-#ifdef AFS_X86_XBSD_ENV
-#include "conf-i386-obsd.h"
-#elif defined(AFS_ALPHA_ENV)
-#include "conf-alpha-bsd.h"
-#else
-#error unknown bsd
-#endif
-#else /* AFS_XBSD_ENV */
-
-#if defined(AFS_LINUX20_ENV)
-#ifdef AFS_PARISC_LINUX20_ENV
-#include "conf-parisc-linux.h"
-#else
-#ifdef AFS_PPC_LINUX20_ENV
-#include "conf-ppc-linux.h"
-#else
-#ifdef AFS_SPARC_LINUX20_ENV
-#include "conf-sparc-linux.h"
-#else
-#ifdef AFS_SPARC64_LINUX20_ENV
-#include "conf-sparc64-linux.h"
-#else
-#ifdef AFS_S390_LINUX20_ENV
-#include "conf-s390-linux.h"
-#else
-#ifdef AFS_ALPHA_LINUX20_ENV
-#include "conf-alpha-linux.h"
-#else
-#ifdef AFS_IA64_LINUX20_ENV
-#include "conf-ia64-linux.h"
-#else
-#ifdef AFS_AMD64_LINUX20_ENV
-#include "conf-amd64-linux.h"
-#else
-#ifdef AFS_PPC64_LINUX20_ENV
-#include "conf-ppc64-linux.h"
-#else
-#ifdef AFS_ARM_LINUX20_ENV
-#include "conf-arm-linux.h"
-#else
-#include "conf-i386-linux.h"
-#endif /* AFS_ARM_LINUX20_ENV */
-#endif /* AFS_PPC64_LINUX20_ENV */
-#endif /* AFS_AMD64_LINUX20_ENV */
-#endif /* AFS_IA64_LINUX20_ENV */
-#endif /* AFS_ALPHA_LINUX20_ENV */
-#endif /* AFS_S390_LINUX20_ENV */
-#endif /* AFS_SPARC64_LINUX20_ENV */
-#endif /* AFS_SPARC_LINUX20_ENV */
-#endif /* AFS_PPC_LINUX20_ENV */
-#endif /* AFS_PARISC_LINUX24_ENV */
-#else
-#if defined(AFS_DARWIN_ENV)
-#include "conf-darwin.h"
-#else
-Sorry,
-    you lose.
-    Figure out what the machine looks like and fix this file to include it.
-#endif
-#endif /* AFS_LINUX20_ENV */
-#endif /* AFS_NT40_ENV */
-#endif /* AFS_XBSD_ENV */
-#endif /* NCR || X86 */
-#endif /* __alpha */
-#endif /* SGI */
-#endif /* NeXT */
-#endif /* HP/UX */
-#endif /* mac */
-#endif /* aix */
-#endif /* sun */
-#endif /* mips */
-#endif /* not vax */
diff --git a/src/des/cbc_encrypt.c b/src/des/cbc_encrypt.c
deleted file mode 100644 (file)
index 1f0d11a..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it -- fewer inner loops.
- * (AUTH_DES_ITER defaults to 16, may be less.)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * These routines form the library interface to the DES facilities.
- *
- * Originally written 8/85 by Steve Miller, MIT Project Athena.
- */
-
-#include "mit-cpyright.h"
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-
-#include "des.h"
-#include "des_prototypes.h"
-
-
-
-#define XPRT_CBC_ENCRYPT
-
-/*
- * This routine performs DES cipher-block-chaining operation, either
- * encrypting from cleartext to ciphertext, if encrypt != 0 or
- * decrypting from ciphertext to cleartext, if encrypt == 0.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext. The cleartext and ciphertext should be in host order.
- *
- * NOTE-- the output is ALWAYS an multiple of 8 bytes long.  If not
- * enough space was provided, your program will get trashed.
- *
- * For encryption, the cleartext string is null padded, at the end, to
- * an integral multiple of eight bytes.
- *
- * For decryption, the ciphertext will be used in integral multiples
- * of 8 bytes, but only the first "length" bytes returned into the
- * cleartext.
- */
-/*
-    des_cblock *in;            * >= length bytes of input text *
-    des_cblock *out;           * >= length bytes of output text *
-    afs_int32 length;  * in bytes *
-    int encrypt;               * 0 ==> decrypt, else encrypt *
-    des_key_schedule key;              * precomputed key schedule *
-    des_cblock *iv;            * 8 bytes of ivec *
-*/
-afs_int32
-des_cbc_encrypt(void * in, void * out, afs_int32 length,
-               des_key_schedule key, des_cblock * iv, int encrypt)
-{
-    afs_uint32 *input = (afs_uint32 *) in;
-    afs_uint32 *output = (afs_uint32 *) out;
-    afs_uint32 *ivec = (afs_uint32 *) iv;
-
-    afs_uint32 i, j;
-    afs_uint32 t_input[2];
-    afs_uint32 t_output[2];
-    unsigned char *t_in_p = (unsigned char *)t_input;
-    afs_uint32 xor_0, xor_1;
-
-    if (encrypt) {
-#ifdef MUSTALIGN
-       if ((afs_int32) ivec & 3) {
-           memcpy((char *)&t_output[0], (char *)ivec++, sizeof(t_output[0]));
-           memcpy((char *)&t_output[1], (char *)ivec, sizeof(t_output[1]));
-       } else
-#endif
-       {
-           t_output[0] = *ivec++;
-           t_output[1] = *ivec;
-       }
-
-       for (i = 0; length > 0; i++, length -= 8) {
-           /* get input */
-#ifdef MUSTALIGN
-           if ((afs_int32) input & 3) {
-               memcpy((char *)&t_input[0], (char *)input++,
-                      sizeof(t_input[0]));
-               memcpy((char *)&t_input[1], (char *)input++,
-                      sizeof(t_input[1]));
-           } else
-#endif
-           {
-               t_input[0] = *input++;
-               t_input[1] = *input++;
-           }
-
-           /* zero pad */
-           if (length < 8)
-               for (j = length; j <= 7; j++)
-                   *(t_in_p + j) = 0;
-
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("clear", length, t_input[0], t_input[1]);
-#endif
-           /* do the xor for cbc into the temp */
-           t_input[0] ^= t_output[0];
-           t_input[1] ^= t_output[1];
-           /* encrypt */
-           (void)des_ecb_encrypt(t_input, t_output, key, encrypt);
-           /* copy temp output and save it for cbc */
-#ifdef MUSTALIGN
-           if ((afs_int32) output & 3) {
-               memcpy((char *)output++, (char *)&t_output[0],
-                      sizeof(t_output[0]));
-               memcpy((char *)output++, (char *)&t_output[1],
-                      sizeof(t_output[1]));
-           } else
-#endif
-           {
-               *output++ = t_output[0];
-               *output++ = t_output[1];
-           }
-
-#ifdef DEBUG
-           if (des_debug) {
-               des_debug_print("xor'ed", i, t_input[0], t_input[1]);
-               des_debug_print("cipher", i, t_output[0], t_output[1]);
-           }
-#endif
-       }
-       return 0;
-    }
-
-    else {
-       /* decrypt */
-#ifdef MUSTALIGN
-       if ((afs_int32) ivec & 3) {
-           memcpy((char *)&xor_0, (char *)ivec++, sizeof(xor_0));
-           memcpy((char *)&xor_1, (char *)ivec, sizeof(xor_1));
-       } else
-#endif
-       {
-           xor_0 = *ivec++;
-           xor_1 = *ivec;
-       }
-
-       for (i = 0; length > 0; i++, length -= 8) {
-           /* get input */
-#ifdef MUSTALIGN
-           if ((afs_int32) input & 3) {
-               memcpy((char *)&t_input[0], (char *)input++,
-                      sizeof(t_input[0]));
-               memcpy((char *)&t_input[1], (char *)input++,
-                      sizeof(t_input[0]));
-           } else
-#endif
-           {
-               t_input[0] = *input++;
-               t_input[1] = *input++;
-           }
-
-           /* no padding for decrypt */
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("cipher", i, t_input[0], t_input[1]);
-#else
-#ifdef lint
-           i = i;
-#endif
-#endif
-           /* encrypt */
-           (void)des_ecb_encrypt(t_input, t_output, key, encrypt);
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("out pre xor", i, t_output[0], t_output[1]);
-#endif
-           /* do the xor for cbc into the output */
-           t_output[0] ^= xor_0;
-           t_output[1] ^= xor_1;
-           /* copy temp output */
-#ifdef MUSTALIGN
-           if ((afs_int32) output & 3) {
-               memcpy((char *)output++, (char *)&t_output[0],
-                      sizeof(t_output[0]));
-               memcpy((char *)output++, (char *)&t_output[1],
-                      sizeof(t_output[1]));
-           } else
-#endif
-           {
-               *output++ = t_output[0];
-               *output++ = t_output[1];
-           }
-
-           /* save xor value for next round */
-           xor_0 = t_input[0];
-           xor_1 = t_input[1];
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("clear", i, t_output[0], t_output[1]);
-#endif
-       }
-       return 0;
-    }
-}
diff --git a/src/des/cksum.c b/src/des/cksum.c
deleted file mode 100644 (file)
index 00a5a89..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it-- fewer inner loops.
- * (AUTH_DES_ITER defaults to 16, may be less.)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * These routines form the library interface to the DES facilities.
- *
- *     spm     8/85    MIT project athena
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#define XPRT_CKSUM
-
-/*
- * This routine performs DES cipher-block-chaining checksum operation,
- * a.k.a.  Message Authentication Code.  It ALWAYS encrypts from input
- * to a single 64 bit output MAC checksum.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext. The cleartext and ciphertext should be in host order.
- *
- * NOTE-- the output is ALWAYS 8 bytes long.  If not enough space was
- * provided, your program will get trashed.
- *
- * The input is null padded, at the end (highest addr), to an integral
- * multiple of eight bytes.
- */
-/*
-    des_cblock *in;            * >= length bytes of inputtext *
-    des_cblock *out;           * >= length bytes of outputtext *
-    afs_int32 length;  * in bytes *
-    des_key_schedule key;       * precomputed key schedule *
-    des_cblock *iv;            * 8 bytes of ivec *
-*/
-
-afs_uint32
-des_cbc_cksum(des_cblock * in, des_cblock * out, afs_int32 length,
-             des_key_schedule key, des_cblock * iv)
-{
-    afs_uint32 *input = (afs_uint32 *) in;
-    afs_uint32 *output = (afs_uint32 *) out;
-    afs_uint32 *ivec = (afs_uint32 *) iv;
-
-    afs_uint32 i, j;
-    afs_uint32 t_input[2];
-    afs_uint32 t_output[8];
-    unsigned char *t_in_p = (unsigned char *)t_input;
-
-#ifdef MUSTALIGN
-    if (afs_pointer_to_int(ivec) & 3) {
-       memcpy((char *)&t_output[0], (char *)ivec++, sizeof(t_output[0]));
-       memcpy((char *)&t_output[1], (char *)ivec, sizeof(t_output[1]));
-    } else
-#endif
-    {
-       t_output[0] = *ivec++;
-       t_output[1] = *ivec;
-    }
-
-    for (i = 0; length > 0; i++, length -= 8) {
-       /* get input */
-#ifdef MUSTALIGN
-      if (afs_pointer_to_int(input) & 3) {
-           memcpy((char *)&t_input[0], (char *)input++, sizeof(t_input[0]));
-           memcpy((char *)&t_input[1], (char *)input++, sizeof(t_input[1]));
-       } else
-#endif
-       {
-           t_input[0] = *input++;
-           t_input[1] = *input++;
-       }
-
-       /* zero pad */
-       if (length < 8)
-           for (j = length; j <= 7; j++)
-               *(t_in_p + j) = 0;
-
-#ifdef DEBUG
-       if (des_debug)
-           des_debug_print("clear", length, t_input[0], t_input[1]);
-#endif
-       /* do the xor for cbc into the temp */
-       t_input[0] ^= t_output[0];
-       t_input[1] ^= t_output[1];
-       /* encrypt */
-       (void)des_ecb_encrypt(t_input, t_output, key, 1);
-#ifdef DEBUG
-       if (des_debug) {
-           des_debug_print("xor'ed", i, t_input[0], t_input[1]);
-           des_debug_print("cipher", i, t_output[0], t_output[1]);
-       }
-#else
-#ifdef lint
-       i = i;
-#endif
-#endif
-    }
-    /* copy temp output and save it for checksum */
-#ifdef MUSTALIGN
-    if (afs_pointer_to_int(output) & 3) {
-       memcpy((char *)output++, (char *)&t_output[0], sizeof(t_output[0]));
-       memcpy((char *)output, (char *)&t_output[1], sizeof(t_output[1]));
-    } else
-#endif
-    {
-       *output++ = t_output[0];
-       *output = t_output[1];
-    }
-
-    return (afs_uint32) t_output[1];
-}
diff --git a/src/des/conf-aix-ibm.h b/src/des/conf-aix-ibm.h
deleted file mode 100644 (file)
index 3f53d7d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: IBM AIX 2.2.1 (RT/PC)
- */
-
-#include <mit-cpyright.h>
-
-/* WARNING: This is currently identical to conf-bsd-ibm032.h and should probably change for AIX!! */
-#define BSDUNIX                        /* This screwes us up in read_pssword */
-#define IBMWS
-#define IBMWSASM
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-alpha-bsd.h b/src/des/conf-alpha-bsd.h
deleted file mode 100644 (file)
index d40cdef..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Alpha
- */
-
-#include <mit-cpyright.h>
-
-#define ALPHA
-
-/* 'course this is a joke, but I am not going to rewrite this mess */
-#define BITS32
-
-#define BIG
-#define LSBFIRST
-#define BSDUNIX
-#define MUSTALIGN
diff --git a/src/des/conf-alpha-linux.h b/src/des/conf-alpha-linux.h
deleted file mode 100644 (file)
index 5246e0d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Alpha
- */
-
-#include <mit-cpyright.h>
-
-#define ALPHA
-
-/* 'course this is a joke, but I am not going to rewrite this mess */
-#define BITS32
-
-#define BIG
-#define LSBFIRST
diff --git a/src/des/conf-amd64-linux.h b/src/des/conf-amd64-linux.h
deleted file mode 100644 (file)
index 8118f4c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define LSBFIRST
diff --git a/src/des/conf-arm-linux.h b/src/des/conf-arm-linux.h
deleted file mode 100644 (file)
index 66f80b6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Linux on Intel
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define LSBFIRST
diff --git a/src/des/conf-bsd-alpha.h b/src/des/conf-bsd-alpha.h
deleted file mode 100644 (file)
index 635cd83..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Alpha
- */
-
-#include <mit-cpyright.h>
-
-#define ALPHA
-
-/* 'course this is a joke, but I am not going to rewrite this mess */
-#define BITS32
-
-#define BIG
-#define LSBFIRST
-#define BSDUNIX
diff --git a/src/des/conf-bsd-i32.h b/src/des/conf-bsd-i32.h
deleted file mode 100644 (file)
index d8f4462..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: IBM 032 (RT/PC)
- */
-
-#include <mit-cpyright.h>
-
-#define BSDUNIX
-#define IBMWS
-#define IBMWSASM
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-bsd-ncr.h b/src/des/conf-bsd-ncr.h
deleted file mode 100644 (file)
index 59b93ff..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define LSBFIRST
-/*#define MUSTALIGN*/
diff --git a/src/des/conf-bsd-sun.h b/src/des/conf-bsd-sun.h
deleted file mode 100644 (file)
index 973542e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-bsdvax.h b/src/des/conf-bsdvax.h
deleted file mode 100644 (file)
index 16d10fd..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: VAX
- */
-
-#include <mit-cpyright.h>
-
-#define VAX
-#define BITS32
-#define BIG
-#define LSBFIRST
-#define BSDUNIX
-
-#ifndef __STDC__
-#ifndef NOASM
-#define VAXASM
-#endif /* no assembly */
-#endif /* standard C */
diff --git a/src/des/conf-darwin.h b/src/des/conf-darwin.h
deleted file mode 100644 (file)
index bad6006..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#define BITS32
-#define BIG
-#undef BSDUNIX
-#if defined(__ppc__) || defined(__ppc64__)
-#define MSBFIRST
-#elif defined(__i386__) || defined(__amd64__) || defined(__arm__)
-#define LSBFIRST
-#else
-#error "MSBFIRST or LSBFIRST undefined"
-#endif
-#define MUSTALIGN
-#if !defined(KERNEL) && defined(AFS_DARWIN80_ENV)
-extern int _darwin_swap_long_bytes_bit_number(afs_uint32 x);
-extern char *_darwin_whichstr[];
-extern int _darwin_which;
-#endif /* !KERNEL && AFS_DARWIN80_ENV */
diff --git a/src/des/conf-hp9000s300.h b/src/des/conf-hp9000s300.h
deleted file mode 100644 (file)
index 7a03bac..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define BSDUNIX
-#define MUSTALIGN
diff --git a/src/des/conf-hp9000s700.h b/src/des/conf-hp9000s700.h
deleted file mode 100644 (file)
index 7a03bac..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define BSDUNIX
-#define MUSTALIGN
diff --git a/src/des/conf-hp9000s800.h b/src/des/conf-hp9000s800.h
deleted file mode 100644 (file)
index 4f0d7a1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define BSDUNIX
diff --git a/src/des/conf-i386-linux.h b/src/des/conf-i386-linux.h
deleted file mode 100644 (file)
index 66f80b6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Linux on Intel
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define LSBFIRST
diff --git a/src/des/conf-i386-obsd.h b/src/des/conf-i386-obsd.h
deleted file mode 100644 (file)
index 1fc9f96..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define NOASM
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define LSBFIRST
diff --git a/src/des/conf-ia64-linux.h b/src/des/conf-ia64-linux.h
deleted file mode 100644 (file)
index 8118f4c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define LSBFIRST
diff --git a/src/des/conf-ibm370.h b/src/des/conf-ibm370.h
deleted file mode 100644 (file)
index 270a339..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: IBM 370
- */
-
-#include <mit-cpyright.h>
-
-/* What else? */
-#define BIG
-#define NONASCII
-#define SHORTNAMES
diff --git a/src/des/conf-mips.h b/src/des/conf-mips.h
deleted file mode 100644 (file)
index a95d065..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: MIPS
- */
-
-#include <mit-cpyright.h>
-
-#define MIPS
-#define BITS32
-#define BIG
-#define LSBFIRST
-#define BSDUNIX
-#define MUSTALIGN
diff --git a/src/des/conf-next.h b/src/des/conf-next.h
deleted file mode 100644 (file)
index 042a948..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
-** Institutional File System Project
-** University of Michigan
-**
-*/
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-parisc-linux.h b/src/des/conf-parisc-linux.h
deleted file mode 100644 (file)
index 3d29372..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-pc.h b/src/des/conf-pc.h
deleted file mode 100644 (file)
index d78cca0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: IBM PC 8086
- */
-
-#include <mit-cpyright.h>
-
-#define IBMPC
-#define BITS16
-#define CROSSMSDOS
-#define LSBFIRST
diff --git a/src/des/conf-ppc-darwin.h b/src/des/conf-ppc-darwin.h
deleted file mode 100644 (file)
index 9121d2b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define BITS32
-#define BIG
-#undef BSDUNIX
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-ppc-linux.h b/src/des/conf-ppc-linux.h
deleted file mode 100644 (file)
index 3d29372..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-ppc64-linux.h b/src/des/conf-ppc64-linux.h
deleted file mode 100644 (file)
index 3d29372..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-s390-linux.h b/src/des/conf-s390-linux.h
deleted file mode 100644 (file)
index 90a74d7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Linux on Intel
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-sgi.h b/src/des/conf-sgi.h
deleted file mode 100644 (file)
index 255c9de..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: SGI
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-sparc-linux.h b/src/des/conf-sparc-linux.h
deleted file mode 100644 (file)
index 90a74d7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Linux on Intel
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-sparc64-linux.h b/src/des/conf-sparc64-linux.h
deleted file mode 100644 (file)
index 90a74d7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: Linux on Intel
- */
-
-#include <mit-cpyright.h>
-
-#define BITS32
-#define BIG
-#define MSBFIRST
-#define MUSTALIGN
diff --git a/src/des/conf-winnt.h b/src/des/conf-winnt.h
deleted file mode 100644 (file)
index d94edd6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Machine-type definitions: IBM PC  windows NT
- */
-
-#include <mit-cpyright.h>
-
-#define LSBFIRST 1
-#define BITS32 1
-#define MOASM 1
-#define BIG 1
diff --git a/src/des/conf.h b/src/des/conf.h
deleted file mode 100644 (file)
index 48191cc..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Configuration info for operating system, hardware description,
- * language implementation, C library, etc.
- *
- * This file should be included in (almost) every file in the Kerberos
- * sources, and probably should *not* be needed outside of those
- * sources.  (How do we deal with /usr/include/des.h and
- * /usr/include/krb.h?)
- */
-
-#ifndef _CONF_H_
-
-#include "mit-cpyright.h"
-
-#include "andrew-conf.h"
-
-#ifdef SHORTNAMES
-#include "names.h"
-#endif
-
-/*
- * Language implementation-specific definitions
- */
-
-/* special cases */
-#ifdef __HIGHC__
-/* broken implementation of ANSI C */
-#undef __STDC__
-#endif
-
-#ifndef __STDC__
-#define const
-#define volatile
-#define signed
-typedef char *pointer;         /* pointer to generic data */
-#define PROTOTYPE(p) ()
-#else
-typedef void *pointer;
-#define PROTOTYPE(p) p
-#endif
-
-/* Does your compiler understand "void"? */
-#ifdef notdef
-#define void int
-#endif
-
-/*
- * A few checks to see that necessary definitions are included.
- */
-
-/* byte order */
-
-#ifndef MSBFIRST
-#ifndef LSBFIRST
-/* #error byte order not defined */
-Error:byte order not defined.
-#endif
-#endif
-/* machine size */
-#ifndef BITS16
-#ifndef BITS32
-Error:how big is this machine anyways ?
-#endif
-#endif
-/* end of checks */
-#endif /* _CONF_H_ */
diff --git a/src/des/config-bsd-mac.h b/src/des/config-bsd-mac.h
deleted file mode 100644 (file)
index e20e989..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define MSBFIRST
diff --git a/src/des/crypt.c b/src/des/crypt.c
deleted file mode 100644 (file)
index 45938b5..0000000
+++ /dev/null
@@ -1,989 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Tom Truscott.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifdef AFS_NT40_ENV
-#include <windows.h>
-#endif
-#include <stdlib.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-/*
- * UNIX password, and DES, encryption.
- * By Tom Truscott, trt@rti.rti.org,
- * from algorithms by Robert W. Baldwin and James Gillogly.
- *
- * References:
- * "Mathematical Cryptology for Computer Scientists and Mathematicians,"
- * by Wayne Patterson, 1987, ISBN 0-8476-7438-X.
- *
- * "Password Security: A Case History," R. Morris and Ken Thompson,
- * Communications of the ACM, vol. 22, pp. 594-597, Nov. 1979.
- *
- * "DES will be Totally Insecure within Ten Years," M.E. Hellman,
- * IEEE Spectrum, vol. 16, pp. 32-39, July 1979.
- */
-
-/* =====  Configuration ==================== */
-
-/*
- * define "MUST_ALIGN" if your compiler cannot load/store
- * long integers at arbitrary (e.g. odd) memory locations.
- * (Either that or never pass unaligned addresses to des_cipher!)
- */
-#if !defined(vax)
-#define        MUST_ALIGN
-#endif
-
-#ifdef CHAR_BITS
-#if CHAR_BITS != 8
-#error C_block structure assumes 8 bit characters
-#endif
-#endif
-
-/*
- * define "B64" to be the declaration for a 64 bit integer.
- * XXX this feature is currently unused, see "endian" comment below.
- */
-#if defined(cray)
-#define        B64     long
-#endif
-#if defined(convex)
-#define        B64     long long
-#endif
-
-/*
- * define "LARGEDATA" to get faster permutations, by using about 72 kilobytes
- * of lookup tables.  This speeds up des_setkey() and des_cipher(), but has
- * little effect on crypt().
- */
-#if defined(notdef)
-#define        LARGEDATA
-#endif
-
-/* compile with "-DSTATIC=int" when profiling */
-#ifndef STATIC
-#define        STATIC  static
-#endif
-#ifdef CRYPT_DEBUG
-STATIC prtab();
-#endif
-
-/* ==================================== */
-
-/*
- * Cipher-block representation (Bob Baldwin):
- *
- * DES operates on groups of 64 bits, numbered 1..64 (sigh).  One
- * representation is to store one bit per byte in an array of bytes.  Bit N of
- * the NBS spec is stored as the LSB of the Nth byte (index N-1) in the array.
- * Another representation stores the 64 bits in 8 bytes, with bits 1..8 in the
- * first byte, 9..16 in the second, and so on.  The DES spec apparently has
- * bit 1 in the MSB of the first byte, but that is particularly noxious so we
- * bit-reverse each byte so that bit 1 is the LSB of the first byte, bit 8 is
- * the MSB of the first byte.  Specifically, the 64-bit input data and key are
- * converted to LSB format, and the output 64-bit block is converted back into
- * MSB format.
- *
- * DES operates internally on groups of 32 bits which are expanded to 48 bits
- * by permutation E and shrunk back to 32 bits by the S boxes.  To speed up
- * the computation, the expansion is applied only once, the expanded
- * representation is maintained during the encryption, and a compression
- * permutation is applied only at the end.  To speed up the S-box lookups,
- * the 48 bits are maintained as eight 6 bit groups, one per byte, which
- * directly feed the eight S-boxes.  Within each byte, the 6 bits are the
- * most significant ones.  The low two bits of each byte are zero.  (Thus,
- * bit 1 of the 48 bit E expansion is stored as the "4"-valued bit of the
- * first byte in the eight byte representation, bit 2 of the 48 bit value is
- * the "8"-valued bit, and so on.)  In fact, a combined "SPE"-box lookup is
- * used, in which the output is the 64 bit result of an S-box lookup which
- * has been permuted by P and expanded by E, and is ready for use in the next
- * iteration.  Two 32-bit wide tables, SPE[0] and SPE[1], are used for this
- * lookup.  Since each byte in the 48 bit path is a multiple of four, indexed
- * lookup of SPE[0] and SPE[1] is simple and fast.  The key schedule and
- * "salt" are also converted to this 8*(6+2) format.  The SPE table size is
- * 8*64*8 = 4K bytes.
- *
- * To speed up bit-parallel operations (such as XOR), the 8 byte
- * representation is "union"ed with 32 bit values "i0" and "i1", and, on
- * machines which support it, a 64 bit value "b64".  This data structure,
- * "C_block", has two problems.  First, alignment restrictions must be
- * honored.  Second, the byte-order (e.g. little-endian or big-endian) of
- * the architecture becomes visible.
- *
- * The byte-order problem is unfortunate, since on the one hand it is good
- * to have a machine-independent C_block representation (bits 1..8 in the
- * first byte, etc.), and on the other hand it is good for the LSB of the
- * first byte to be the LSB of i0.  We cannot have both these things, so we
- * currently use the "little-endian" representation and avoid any multi-byte
- * operations that depend on byte order.  This largely precludes use of the
- * 64-bit datatype since the relative order of i0 and i1 are unknown.  It
- * also inhibits grouping the SPE table to look up 12 bits at a time.  (The
- * 12 bits can be stored in a 16-bit field with 3 low-order zeroes and 1
- * high-order zero, providing fast indexing into a 64-bit wide SPE.)  On the
- * other hand, 64-bit datatypes are currently rare, and a 12-bit SPE lookup
- * requires a 128 kilobyte table, so perhaps this is not a big loss.
- *
- * Permutation representation (Jim Gillogly):
- *
- * A transformation is defined by its effect on each of the 8 bytes of the
- * 64-bit input.  For each byte we give a 64-bit output that has the bits in
- * the input distributed appropriately.  The transformation is then the OR
- * of the 8 sets of 64-bits.  This uses 8*256*8 = 16K bytes of storage for
- * each transformation.  Unless LARGEDATA is defined, however, a more compact
- * table is used which looks up 16 4-bit "chunks" rather than 8 8-bit chunks.
- * The smaller table uses 16*16*8 = 2K bytes for each transformation.  This
- * is slower but tolerable, particularly for password encryption in which
- * the SPE transformation is iterated many times.  The small tables total 9K
- * bytes, the large tables total 72K bytes.
- *
- * The transformations used are:
- * IE3264: MSB->LSB conversion, initial permutation, and expansion.
- *     This is done by collecting the 32 even-numbered bits and applying
- *     a 32->64 bit transformation, and then collecting the 32 odd-numbered
- *     bits and applying the same transformation.  Since there are only
- *     32 input bits, the IE3264 transformation table is half the size of
- *     the usual table.
- * CF6464: Compression, final permutation, and LSB->MSB conversion.
- *     This is done by two trivial 48->32 bit compressions to obtain
- *     a 64-bit block (the bit numbering is given in the "CIFP" table)
- *     followed by a 64->64 bit "cleanup" transformation.  (It would
- *     be possible to group the bits in the 64-bit block so that 2
- *     identical 32->32 bit transformations could be used instead,
- *     saving a factor of 4 in space and possibly 2 in time, but
- *     byte-ordering and other complications rear their ugly head.
- *     Similar opportunities/problems arise in the key schedule
- *     transforms.)
- * PC1ROT: MSB->LSB, PC1 permutation, rotate, and PC2 permutation.
- *     This admittedly baroque 64->64 bit transformation is used to
- *     produce the first code (in 8*(6+2) format) of the key schedule.
- * PC2ROT[0]: Inverse PC2 permutation, rotate, and PC2 permutation.
- *     It would be possible to define 15 more transformations, each
- *     with a different rotation, to generate the entire key schedule.
- *     To save space, however, we instead permute each code into the
- *     next by using a transformation that "undoes" the PC2 permutation,
- *     rotates the code, and then applies PC2.  Unfortunately, PC2
- *     transforms 56 bits into 48 bits, dropping 8 bits, so PC2 is not
- *     invertible.  We get around that problem by using a modified PC2
- *     which retains the 8 otherwise-lost bits in the unused low-order
- *     bits of each byte.  The low-order bits are cleared when the
- *     codes are stored into the key schedule.
- * PC2ROT[1]: Same as PC2ROT[0], but with two rotations.
- *     This is faster than applying PC2ROT[0] twice,
- *
- * The Bell Labs "salt" (Bob Baldwin):
- *
- * The salting is a simple permutation applied to the 48-bit result of E.
- * Specifically, if bit i (1 <= i <= 24) of the salt is set then bits i and
- * i+24 of the result are swapped.  The salt is thus a 24 bit number, with
- * 16777216 possible values.  (The original salt was 12 bits and could not
- * swap bits 13..24 with 36..48.)
- *
- * It is possible, but ugly, to warp the SPE table to account for the salt
- * permutation.  Fortunately, the conditional bit swapping requires only
- * about four machine instructions and can be done on-the-fly with about an
- * 8% performance penalty.
- */
-
-typedef union {
-    unsigned char b[8];
-    struct {
-#if (SIZEOF_LONG == 4)
-       /* long is often faster than a 32-bit bit field */
-       long i0;
-       long i1;
-#else
-       long i0:32;
-       long i1:32;
-#endif
-    } b32;
-#if defined(B64)
-    B64 b64;
-#endif
-} C_block;
-
-/*
- * Convert twenty-four-bit long in host-order
- * to six bits (and 2 low-order zeroes) per char little-endian format.
- */
-#define        TO_SIX_BIT(rslt, src) {                                         \
-               C_block cvt;                                            \
-               cvt.b[0] = (unsigned char) src; src >>= 6;              \
-               cvt.b[1] = (unsigned char) src; src >>= 6;              \
-               cvt.b[2] = (unsigned char) src; src >>= 6;              \
-               cvt.b[3] = (unsigned char) src;                         \
-               rslt = (cvt.b32.i0 & 0x3f3f3f3fL) << 2;                 \
-       }
-
-/*
- * These macros may someday permit efficient use of 64-bit integers.
- */
-#define        ZERO(d,d0,d1)                   d0 = 0, d1 = 0
-#define        LOAD(d,d0,d1,bl)                d0 = (bl).b32.i0, d1 = (bl).b32.i1
-#define        LOADREG(d,d0,d1,s,s0,s1)        d0 = s0, d1 = s1
-#define        OR(d,d0,d1,bl)                  d0 |= (bl).b32.i0, d1 |= (bl).b32.i1
-#define        STORE(s,s0,s1,bl)               (bl).b32.i0 = (s0), (bl).b32.i1 = (s1)
-#define        DCL_BLOCK(d,d0,d1)              long d0, d1
-
-#if defined(LARGEDATA)
-       /* Waste memory like crazy.  Also, do permutations in line */
-#define        LGCHUNKBITS     3
-#define        CHUNKBITS       (1<<LGCHUNKBITS)
-#define        PERM6464(d,d0,d1,cpp,p)                         \
-       LOAD(d,d0,d1,(p)[(0<<CHUNKBITS)+(cpp)[0]]);             \
-       OR (d,d0,d1,(p)[(1<<CHUNKBITS)+(cpp)[1]]);              \
-       OR (d,d0,d1,(p)[(2<<CHUNKBITS)+(cpp)[2]]);              \
-       OR (d,d0,d1,(p)[(3<<CHUNKBITS)+(cpp)[3]]);              \
-       OR (d,d0,d1,(p)[(4<<CHUNKBITS)+(cpp)[4]]);              \
-       OR (d,d0,d1,(p)[(5<<CHUNKBITS)+(cpp)[5]]);              \
-       OR (d,d0,d1,(p)[(6<<CHUNKBITS)+(cpp)[6]]);              \
-       OR (d,d0,d1,(p)[(7<<CHUNKBITS)+(cpp)[7]]);
-#define        PERM3264(d,d0,d1,cpp,p)                         \
-       LOAD(d,d0,d1,(p)[(0<<CHUNKBITS)+(cpp)[0]]);             \
-       OR (d,d0,d1,(p)[(1<<CHUNKBITS)+(cpp)[1]]);              \
-       OR (d,d0,d1,(p)[(2<<CHUNKBITS)+(cpp)[2]]);              \
-       OR (d,d0,d1,(p)[(3<<CHUNKBITS)+(cpp)[3]]);
-#else
-       /* "small data" */
-#define        LGCHUNKBITS     2
-#define        CHUNKBITS       (1<<LGCHUNKBITS)
-#define        PERM6464(d,d0,d1,cpp,p)                         \
-       { C_block tblk; permute(cpp,&tblk,p,8); LOAD (d,d0,d1,tblk); }
-#define        PERM3264(d,d0,d1,cpp,p)                         \
-       { C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); }
-
-STATIC void
-permute(unsigned char *cp, C_block *out, C_block *p, int chars_in)
-{
-    DCL_BLOCK(D, D0, D1);
-    C_block *tp;
-    int t;
-
-    ZERO(D, D0, D1);
-    do {
-       t = *cp++;
-       tp = &p[t & 0xf];
-       OR(D, D0, D1, *tp);
-       p += (1 << CHUNKBITS);
-       tp = &p[t >> 4];
-       OR(D, D0, D1, *tp);
-       p += (1 << CHUNKBITS);
-    } while (--chars_in > 0);
-    STORE(D, D0, D1, *out);
-}
-#endif /* LARGEDATA */
-
-STATIC void init_des(void);
-STATIC void init_perm(C_block [64 / CHUNKBITS][1 << CHUNKBITS],
-                     unsigned char [64], int, int);
-STATIC int des_setkey(const char *key);
-STATIC int des_cipher(const char *in, char *out, long salt, int num_iter);
-
-
-
-/* =====  (mostly) Standard DES Tables ==================== */
-
-static unsigned char IP[] = {  /* initial permutation */
-    58, 50, 42, 34, 26, 18, 10, 2,
-    60, 52, 44, 36, 28, 20, 12, 4,
-    62, 54, 46, 38, 30, 22, 14, 6,
-    64, 56, 48, 40, 32, 24, 16, 8,
-    57, 49, 41, 33, 25, 17, 9, 1,
-    59, 51, 43, 35, 27, 19, 11, 3,
-    61, 53, 45, 37, 29, 21, 13, 5,
-    63, 55, 47, 39, 31, 23, 15, 7,
-};
-
-/* The final permutation is the inverse of IP - no table is necessary */
-
-static unsigned char ExpandTr[] = {    /* expansion operation */
-    32, 1, 2, 3, 4, 5,
-    4, 5, 6, 7, 8, 9,
-    8, 9, 10, 11, 12, 13,
-    12, 13, 14, 15, 16, 17,
-    16, 17, 18, 19, 20, 21,
-    20, 21, 22, 23, 24, 25,
-    24, 25, 26, 27, 28, 29,
-    28, 29, 30, 31, 32, 1,
-};
-
-static unsigned char PC1[] = { /* permuted choice table 1 */
-    57, 49, 41, 33, 25, 17, 9,
-    1, 58, 50, 42, 34, 26, 18,
-    10, 2, 59, 51, 43, 35, 27,
-    19, 11, 3, 60, 52, 44, 36,
-
-    63, 55, 47, 39, 31, 23, 15,
-    7, 62, 54, 46, 38, 30, 22,
-    14, 6, 61, 53, 45, 37, 29,
-    21, 13, 5, 28, 20, 12, 4,
-};
-
-static unsigned char Rotates[] = {     /* PC1 rotation schedule */
-    1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1,
-};
-
-/* note: each "row" of PC2 is left-padded with bits that make it invertible */
-static unsigned char PC2[] = { /* permuted choice table 2 */
-    9, 18, 14, 17, 11, 24, 1, 5,
-    22, 25, 3, 28, 15, 6, 21, 10,
-    35, 38, 23, 19, 12, 4, 26, 8,
-    43, 54, 16, 7, 27, 20, 13, 2,
-
-    0, 0, 41, 52, 31, 37, 47, 55,
-    0, 0, 30, 40, 51, 45, 33, 48,
-    0, 0, 44, 49, 39, 56, 34, 53,
-    0, 0, 46, 42, 50, 36, 29, 32,
-};
-
-static unsigned char S[8][64] = {      /* 48->32 bit substitution tables */
-    /* S[1]                 */
-    {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
-     0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
-     4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
-     15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,},
-    /* S[2]                 */
-    {15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
-     3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
-     0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
-     13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,},
-    /* S[3]                 */
-    {10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
-     13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
-     13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
-     1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,},
-    /* S[4]                 */
-    {7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
-     13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
-     10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
-     3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,},
-    /* S[5]                 */
-    {2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
-     14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
-     4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
-     11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,},
-    /* S[6]                 */
-    {12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
-     10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
-     9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
-     4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,},
-    /* S[7]                 */
-    {4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
-     13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
-     1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
-     6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,},
-    /* S[8]                 */
-    {13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
-     1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
-     7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
-     2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11,}
-};
-
-static unsigned char P32Tr[] = {       /* 32-bit permutation function */
-    16, 7, 20, 21,
-    29, 12, 28, 17,
-    1, 15, 23, 26,
-    5, 18, 31, 10,
-    2, 8, 24, 14,
-    32, 27, 3, 9,
-    19, 13, 30, 6,
-    22, 11, 4, 25,
-};
-
-static unsigned char CIFP[] = {        /* compressed/interleaved permutation */
-    1, 2, 3, 4, 17, 18, 19, 20,
-    5, 6, 7, 8, 21, 22, 23, 24,
-    9, 10, 11, 12, 25, 26, 27, 28,
-    13, 14, 15, 16, 29, 30, 31, 32,
-
-    33, 34, 35, 36, 49, 50, 51, 52,
-    37, 38, 39, 40, 53, 54, 55, 56,
-    41, 42, 43, 44, 57, 58, 59, 60,
-    45, 46, 47, 48, 61, 62, 63, 64,
-};
-
-static unsigned char itoa64[] =        /* 0..63 => ascii-64 */
-    "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-
-
-/* =====  Tables that are initialized at run time  ==================== */
-
-
-static unsigned char a64toi[128];      /* ascii-64 => 0..63 */
-
-/* Initial key schedule permutation */
-static C_block PC1ROT[64 / CHUNKBITS][1 << CHUNKBITS];
-
-/* Subsequent key schedule rotation permutations */
-static C_block PC2ROT[2][64 / CHUNKBITS][1 << CHUNKBITS];
-
-/* Initial permutation/expansion table */
-static C_block IE3264[32 / CHUNKBITS][1 << CHUNKBITS];
-
-/* Table that combines the S, P, and E operations.  */
-static long SPE[2][8][64];
-
-/* compressed/interleaved => final permutation table */
-static C_block CF6464[64 / CHUNKBITS][1 << CHUNKBITS];
-
-
-/* ==================================== */
-
-
-static C_block constdatablock; /* encryption constant */
-static char cryptresult[1 + 4 + 4 + 11 + 1];   /* encrypted result */
-
-/*
- * Return a pointer to static data consisting of the "setting"
- * followed by an encryption produced by the "key" and "setting".
- */
-char *
-crypt(const char *key, const char *setting)
-{
-    char *encp;
-    long i;
-    int t;
-    long salt;
-    int num_iter, salt_size;
-    C_block keyblock, rsltblock;
-
-
-    for (i = 0; i < 8; i++) {
-       if ((t = 2 * (unsigned char)(*key)) != 0)
-           key++;
-       keyblock.b[i] = t;
-    }
-    if (des_setkey((char *)keyblock.b))        /* also initializes "a64toi" */
-       return (NULL);
-
-    encp = &cryptresult[0];
-    switch (*setting) {
-    case '_':                  /* was EFMT1 */
-       /*
-        * Involve the rest of the password 8 characters at a time.
-        */
-       while (*key) {
-           if (des_cipher((char *)&keyblock, (char *)&keyblock, 0L, 1))
-               return (NULL);
-           for (i = 0; i < 8; i++) {
-               if ((t = 2 * (unsigned char)(*key)) != 0)
-                   key++;
-               keyblock.b[i] ^= t;
-           }
-           if (des_setkey((char *)keyblock.b))
-               return (NULL);
-       }
-
-       *encp++ = *setting++;
-
-       /* get iteration count */
-       num_iter = 0;
-       for (i = 4; --i >= 0;) {
-           if ((t = (unsigned char)setting[i]) == '\0')
-               t = '.';
-           encp[i] = t;
-           num_iter = (num_iter << 6) | a64toi[t];
-       }
-       setting += 4;
-       encp += 4;
-       salt_size = 4;
-       break;
-    default:
-       num_iter = 25;
-       salt_size = 2;
-    }
-
-    salt = 0;
-    for (i = salt_size; --i >= 0;) {
-       if ((t = (unsigned char)setting[i]) == '\0')
-           t = '.';
-       encp[i] = t;
-       salt = (salt << 6) | a64toi[t];
-    }
-    encp += salt_size;
-    if (des_cipher
-       ((char *)&constdatablock, (char *)&rsltblock, salt, num_iter))
-       return (NULL);
-
-    /*
-     * Encode the 64 cipher bits as 11 ascii characters.
-     */
-    i = ((long)((rsltblock.b[0] << 8) | rsltblock.b[1]) << 8) | rsltblock.
-       b[2];
-    encp[3] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[2] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[1] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[0] = itoa64[i];
-    encp += 4;
-    i = ((long)((rsltblock.b[3] << 8) | rsltblock.b[4]) << 8) | rsltblock.
-       b[5];
-    encp[3] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[2] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[1] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[0] = itoa64[i];
-    encp += 4;
-    i = ((long)((rsltblock.b[6]) << 8) | rsltblock.b[7]) << 2;
-    encp[2] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[1] = itoa64[i & 0x3f];
-    i >>= 6;
-    encp[0] = itoa64[i];
-
-    encp[3] = 0;
-
-    return (cryptresult);
-}
-
-
-/*
- * The Key Schedule, filled in by des_setkey() or setkey().
- */
-#define        KS_SIZE 16
-static C_block KS[KS_SIZE];
-
-/*
- * Set up the key schedule from the key.
- */
-STATIC int
-des_setkey(const char *key)
-{
-    DCL_BLOCK(K, K0, K1);
-    C_block *ptabp;
-    int i;
-    static int des_ready = 0;
-
-    if (!des_ready) {
-       init_des();
-       des_ready = 1;
-    }
-
-    PERM6464(K, K0, K1, (unsigned char *)key, (C_block *) PC1ROT);
-    key = (char *)&KS[0];
-    STORE(K & ~0x03030303L, K0 & ~0x03030303L, K1, *(C_block *) key);
-    for (i = 1; i < 16; i++) {
-       key += sizeof(C_block);
-       STORE(K, K0, K1, *(C_block *) key);
-       ptabp = (C_block *) PC2ROT[Rotates[i] - 1];
-       PERM6464(K, K0, K1, (unsigned char *)key, ptabp);
-       STORE(K & ~0x03030303L, K0 & ~0x03030303L, K1, *(C_block *) key);
-    }
-    return (0);
-}
-
-/*
- * Encrypt (or decrypt if num_iter < 0) the 8 chars at "in" with abs(num_iter)
- * iterations of DES, using the the given 24-bit salt and the pre-computed key
- * schedule, and store the resulting 8 chars at "out" (in == out is permitted).
- *
- * NOTE: the performance of this routine is critically dependent on your
- * compiler and machine architecture.
- */
-STATIC int
-des_cipher(const char *in, char *out, long salt, int num_iter)
-{
-    /* variables that we want in registers, most important first */
-#if defined(pdp11)
-    int j;
-#endif
-    long L0, L1, R0, R1, k;
-    C_block *kp;
-    int ks_inc, loop_count;
-    C_block B;
-
-    L0 = salt;
-    TO_SIX_BIT(salt, L0);      /* convert to 4*(6+2) format */
-
-#if defined(vax) || defined(pdp11)
-    salt = ~salt;              /* "x &~ y" is faster than "x & y". */
-#define        SALT (~salt)
-#else
-#define        SALT salt
-#endif
-
-#if defined(MUST_ALIGN)
-    B.b[0] = in[0];
-    B.b[1] = in[1];
-    B.b[2] = in[2];
-    B.b[3] = in[3];
-    B.b[4] = in[4];
-    B.b[5] = in[5];
-    B.b[6] = in[6];
-    B.b[7] = in[7];
-    LOAD(L, L0, L1, B);
-#else
-    LOAD(L, L0, L1, *(C_block *) in);
-#endif
-    LOADREG(R, R0, R1, L, L0, L1);
-    L0 &= 0x55555555L;
-    L1 &= 0x55555555L;
-    L0 = (L0 << 1) | L1;       /* L0 is the even-numbered input bits */
-    R0 &= 0xaaaaaaaaL;
-    R1 = (R1 >> 1) & 0x55555555L;
-    L1 = R0 | R1;              /* L1 is the odd-numbered input bits */
-    STORE(L, L0, L1, B);
-    PERM3264(L, L0, L1, B.b, (C_block *) IE3264);      /* even bits */
-    PERM3264(R, R0, R1, B.b + 4, (C_block *) IE3264);  /* odd bits */
-
-    if (num_iter >= 0) {       /* encryption */
-       kp = &KS[0];
-       ks_inc = sizeof(*kp);
-    } else {                   /* decryption */
-       num_iter = -num_iter;
-       kp = &KS[KS_SIZE - 1];
-       ks_inc = -((long)sizeof(*kp));
-    }
-
-    while (--num_iter >= 0) {
-       loop_count = 8;
-       do {
-
-#define        SPTAB(t, i)     (*(long *)((unsigned char *)t + i*(sizeof(long)/4)))
-#if defined(gould)
-           /* use this if B.b[i] is evaluated just once ... */
-#define        DOXOR(x,y,i)    x^=SPTAB(SPE[0][i],B.b[i]); y^=SPTAB(SPE[1][i],B.b[i]);
-#else
-#if defined(pdp11)
-           /* use this if your "long" int indexing is slow */
-#define        DOXOR(x,y,i)    j=B.b[i]; x^=SPTAB(SPE[0][i],j); y^=SPTAB(SPE[1][i],j);
-#else
-           /* use this if "k" is allocated to a register ... */
-#define        DOXOR(x,y,i)    k=B.b[i]; x^=SPTAB(SPE[0][i],k); y^=SPTAB(SPE[1][i],k);
-#endif
-#endif
-
-#define        CRUNCH(p0, p1, q0, q1)  \
-                       k = (q0 ^ q1) & SALT;   \
-                       B.b32.i0 = k ^ q0 ^ kp->b32.i0;         \
-                       B.b32.i1 = k ^ q1 ^ kp->b32.i1;         \
-                       kp = (C_block *)((char *)kp+ks_inc);    \
-                                                       \
-                       DOXOR(p0, p1, 0);               \
-                       DOXOR(p0, p1, 1);               \
-                       DOXOR(p0, p1, 2);               \
-                       DOXOR(p0, p1, 3);               \
-                       DOXOR(p0, p1, 4);               \
-                       DOXOR(p0, p1, 5);               \
-                       DOXOR(p0, p1, 6);               \
-                       DOXOR(p0, p1, 7);
-
-           CRUNCH(L0, L1, R0, R1);
-           CRUNCH(R0, R1, L0, L1);
-       } while (--loop_count != 0);
-       kp = (C_block *) ((char *)kp - (ks_inc * KS_SIZE));
-
-
-       /* swap L and R */
-       L0 ^= R0;
-       L1 ^= R1;
-       R0 ^= L0;
-       R1 ^= L1;
-       L0 ^= R0;
-       L1 ^= R1;
-    }
-
-    /* store the encrypted (or decrypted) result */
-    L0 = ((L0 >> 3) & 0x0f0f0f0fL) | ((L1 << 1) & 0xf0f0f0f0L);
-    L1 = ((R0 >> 3) & 0x0f0f0f0fL) | ((R1 << 1) & 0xf0f0f0f0L);
-    STORE(L, L0, L1, B);
-    PERM6464(L, L0, L1, B.b, (C_block *) CF6464);
-#if defined(MUST_ALIGN)
-    STORE(L, L0, L1, B);
-    out[0] = B.b[0];
-    out[1] = B.b[1];
-    out[2] = B.b[2];
-    out[3] = B.b[3];
-    out[4] = B.b[4];
-    out[5] = B.b[5];
-    out[6] = B.b[6];
-    out[7] = B.b[7];
-#else
-    STORE(L, L0, L1, *(C_block *) out);
-#endif
-    return (0);
-}
-
-
-/*
- * Initialize various tables.  This need only be done once.  It could even be
- * done at compile time, if the compiler were capable of that sort of thing.
- */
-STATIC void
-init_des(void)
-{
-    int i, j;
-    long k;
-    int tableno;
-    static unsigned char perm[64], tmp32[32];  /* "static" for speed */
-
-    /*
-     * table that converts chars "./0-9A-Za-z"to integers 0-63.
-     */
-    for (i = 0; i < 64; i++)
-       a64toi[itoa64[i]] = i;
-
-    /*
-     * PC1ROT - bit reverse, then PC1, then Rotate, then PC2.
-     */
-    for (i = 0; i < 64; i++)
-       perm[i] = 0;
-    for (i = 0; i < 64; i++) {
-       if ((k = PC2[i]) == 0)
-           continue;
-       k += Rotates[0] - 1;
-       if ((k % 28) < Rotates[0])
-           k -= 28;
-       k = PC1[k];
-       if (k > 0) {
-           k--;
-           k = (k | 07) - (k & 07);
-           k++;
-       }
-       perm[i] = (unsigned char)k;
-    }
-#ifdef CRYPT_DEBUG
-    prtab("pc1tab", perm, 8);
-#endif
-    init_perm(PC1ROT, perm, 8, 8);
-
-    /*
-     * PC2ROT - PC2 inverse, then Rotate (once or twice), then PC2.
-     */
-    for (j = 0; j < 2; j++) {
-       unsigned char pc2inv[64];
-       for (i = 0; i < 64; i++)
-           perm[i] = pc2inv[i] = 0;
-       for (i = 0; i < 64; i++) {
-           if ((k = PC2[i]) == 0)
-               continue;
-           pc2inv[k - 1] = i + 1;
-       }
-       for (i = 0; i < 64; i++) {
-           if ((k = PC2[i]) == 0)
-               continue;
-           k += j;
-           if ((k % 28) <= j)
-               k -= 28;
-           perm[i] = pc2inv[k];
-       }
-#ifdef CRYPT_DEBUG
-       prtab("pc2tab", perm, 8);
-#endif
-       init_perm(PC2ROT[j], perm, 8, 8);
-    }
-
-    /*
-     * Bit reverse, then initial permutation, then expansion.
-     */
-    for (i = 0; i < 8; i++) {
-       for (j = 0; j < 8; j++) {
-           k = (j < 2) ? 0 : IP[ExpandTr[i * 6 + j - 2] - 1];
-           if (k > 32)
-               k -= 32;
-           else if (k > 0)
-               k--;
-           if (k > 0) {
-               k--;
-               k = (k | 07) - (k & 07);
-               k++;
-           }
-           perm[i * 8 + j] = (unsigned char)k;
-       }
-    }
-#ifdef CRYPT_DEBUG
-    prtab("ietab", perm, 8);
-#endif
-    init_perm(IE3264, perm, 4, 8);
-
-    /*
-     * Compression, then final permutation, then bit reverse.
-     */
-    for (i = 0; i < 64; i++) {
-       k = IP[CIFP[i] - 1];
-       if (k > 0) {
-           k--;
-           k = (k | 07) - (k & 07);
-           k++;
-       }
-       perm[k - 1] = i + 1;
-    }
-#ifdef CRYPT_DEBUG
-    prtab("cftab", perm, 8);
-#endif
-    init_perm(CF6464, perm, 8, 8);
-
-    /*
-     * SPE table
-     */
-    for (i = 0; i < 48; i++)
-       perm[i] = P32Tr[ExpandTr[i] - 1];
-    for (tableno = 0; tableno < 8; tableno++) {
-       for (j = 0; j < 64; j++) {
-           k = (((j >> 0) & 01) << 5) | (((j >> 1) & 01) << 3) |
-               (((j >> 2) & 01) << 2) | (((j >> 3) & 01) << 1) |
-               (((j >> 4) & 01) << 0) | (((j >> 5) & 01) << 4);
-           k = S[tableno][k];
-           k = (((k >> 3) & 01) << 0) | (((k >> 2) & 01) << 1) |
-               (((k >> 1) & 01) << 2) | (((k >> 0) & 01) << 3);
-           for (i = 0; i < 32; i++)
-               tmp32[i] = 0;
-           for (i = 0; i < 4; i++)
-               tmp32[4 * tableno + i] = (k >> i) & 01;
-           k = 0;
-           for (i = 24; --i >= 0;)
-               k = (k << 1) | tmp32[perm[i] - 1];
-           TO_SIX_BIT(SPE[0][tableno][j], k);
-           k = 0;
-           for (i = 24; --i >= 0;)
-               k = (k << 1) | tmp32[perm[i + 24] - 1];
-           TO_SIX_BIT(SPE[1][tableno][j], k);
-       }
-    }
-}
-
-/*
- * Initialize "perm" to represent transformation "p", which rearranges
- * (perhaps with expansion and/or contraction) one packed array of bits
- * (of size "chars_in" characters) into another array (of size "chars_out"
- * characters).
- *
- * "perm" must be all-zeroes on entry to this routine.
- */
-STATIC void
-init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS],
-         unsigned char p[64], int chars_in, int chars_out)
-{
-    int i, j, k, l;
-
-    for (k = 0; k < chars_out * 8; k++) {      /* each output bit position */
-       l = p[k] - 1;           /* where this bit comes from */
-       if (l < 0)
-           continue;           /* output bit is always 0 */
-       i = l >> LGCHUNKBITS;   /* which chunk this bit comes from */
-       l = 1 << (l & (CHUNKBITS - 1)); /* mask for this bit */
-       for (j = 0; j < (1 << CHUNKBITS); j++) {        /* each chunk value */
-           if ((j & l) != 0)
-               perm[i][j].b[k >> 3] |= 1 << (k & 07);
-       }
-    }
-}
-
-/*
- * "setkey" routine (for backwards compatibility)
- */
-#if 0                          /* static and doesn't appear to be referenced */
-STATIC int
-setkey(key)
-     const char *key;
-{
-    int i, j, k;
-    C_block keyblock;
-
-    for (i = 0; i < 8; i++) {
-       k = 0;
-       for (j = 0; j < 8; j++) {
-           k <<= 1;
-           k |= (unsigned char)*key++;
-       }
-       keyblock.b[i] = k;
-    }
-    return (des_setkey((char *)keyblock.b));
-}
-#endif
-
-#if 0
-/*
- * "encrypt" routine (for backwards compatibility)
- */
-int
-encrypt(block, flag)
-     char *block;
-     int flag;
-{
-    int i, j, k;
-    C_block cblock;
-
-    for (i = 0; i < 8; i++) {
-       k = 0;
-       for (j = 0; j < 8; j++) {
-           k <<= 1;
-           k |= (unsigned char)*block++;
-       }
-       cblock.b[i] = k;
-    }
-    if (des_cipher((char *)&cblock, (char *)&cblock, 0L, (flag ? -1 : 1)))
-       return (1);
-    for (i = 7; i >= 0; i--) {
-       k = cblock.b[i];
-       for (j = 7; j >= 0; j--) {
-           *--block = k & 01;
-           k >>= 1;
-       }
-    }
-    return (0);
-}
-#endif
-
-#ifdef CRYPT_DEBUG
-STATIC
-prtab(char *s, unsigned char *t, int num_rows)
-{
-    int i, j;
-
-    (void)printf("%s:\n", s);
-    for (i = 0; i < num_rows; i++) {
-       for (j = 0; j < 8; j++) {
-           (void)printf("%3d", t[i * 8 + j]);
-       }
-       (void)printf("\n");
-    }
-    (void)printf("\n");
-}
-#endif
diff --git a/src/des/crypt.h b/src/des/crypt.h
deleted file mode 100644 (file)
index ec168fe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __CRYPT_H_ENV__
-#define __CRYPT_H_ENV__ 1
-
-char *crypt(char *, char *);
-
-#endif /* __CRYPT_H_ENV__ */
diff --git a/src/des/debug_decl.c b/src/des/debug_decl.c
deleted file mode 100644 (file)
index 4b37a61..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * Declaration of debugging flag.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-int des_debug = 0;
diff --git a/src/des/des.c b/src/des/des.c
deleted file mode 100644 (file)
index 813ef47..0000000
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it-- fewer inner loops.
- * (AUTH_DES_ITER defaults to 16, may be less.)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext.
- *
- * All registers labeled imply Vax using the Ultrix or 4.2bsd
- * compiler.
- *
- *
- *     NOTE:  bit and byte numbering:
- *                     DES algorithm is defined in terms of bits of L
- *                     followed by bits of R.
-
- *             bit 0  ==> lsb of L
- *             bit 63 ==> msb of R
- *
- * Always work in register pairs, FROM L1,R1 TO L2,R2 to make
- * bookkeeping easier.
- *
- * originally written by Steve Miller, MIT Project Athena
- */
-#include "mit-cpyright.h"
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifndef KERNEL
-#include <stdio.h>
-#include <string.h>
-#endif
-#ifdef AFS_PTHREAD_ENV
-#include <pthread.h>
-#endif /* AFS_PTHREAD_ENV */
-#include "des.h"
-#include "des_internal.h"
-#include "s_table.h"
-#ifdef BIG
-#include "p_table.h"
-#endif
-
-#include "des_prototypes.h"
-
-#define XPRT_DES
-
-#ifdef DEBUG
-#define DBG_PRINT(s) if (des_debug & 2) \
-    des_debug_print(s,i,L1&0xffff,(L1>>16)&0xffff, \
-               R1&0xffff,(R1>>16)&0xffff)
-#else
-#define DBG_PRINT(s)
-#endif
-
-/* encrypt == 0  ==> decrypt, else encrypt */
-
-afs_int32
-des_ecb_encrypt(void * clear, void * cipher,
-               des_key_schedule schedule, int encrypt)
-{
-    /* better pass 8 bytes, length not checked here */
-
-    afs_uint32 R1 = 0;
-    afs_uint32 L1 = 0; /* R1 = r10, L1 = r9 */
-    afs_uint32 R2 = 0, L2 = 0; /* R2 = r8, L2 = r7 */
-    afs_int32 i;
-    /* one more registers left on VAX, see below P_temp_p */
-#ifdef BITS16
-    sbox_in_16_a S_in_16_a;
-    sbox_in_16_b S_in_16_b;
-    sbox_in_16_c S_in_16_c;
-    unsigned int *S_in_a_16_p = (unsigned int *)&S_in_16_a;
-    unsigned int *S_in_b_16_p = (unsigned int *)&S_in_16_b;
-    unsigned int *S_in_c_16_p = (unsigned int *)&S_in_16_c;
-#endif
-#ifndef BITS32
-#ifndef BITS16
-#error dunno how to do this machine type, you lose;
-#endif
-#endif
-    volatile afs_uint32 P_temp;
-    volatile unsigned char *P_temp_p = (unsigned char *)&P_temp;
-#ifdef BITS16
-    sbox_out S_out;
-    afs_uint32 *S_out_p = (afs_uint32 *) & S_out;
-#endif
-    afs_uint32 R_save, L_save;
-#ifdef DEBUG
-    afs_uint32 dbg_tmp[2];
-#endif
-    /*
-     * Use L1,R1 and L2,R2 as two sets of "64-bit" registers always
-     * work from L1,R1 input to L2,R2 output; initialize the cleartext
-     * into registers.
-     */
-#ifdef MUSTALIGN
-#ifdef DEBUG
-    /*
-     * If the alignment is wrong, the programmer really screwed up --
-     * we aren't even getting the right data type.  His problem.  Keep
-     * this code for debugging.
-     */
-    /* Make sure schedule is ok */
-    if ((afs_int32) schedule & 3) {
-       fprintf(stderr, "des.c schedule arg pointer not aligned\n");
-       abort();
-    }
-#endif
-    if (afs_pointer_to_int(clear) & 3) {
-       memcpy((char *)(&L_save), (char *)clear, sizeof(L_save));
-       clear=((afs_uint32*)clear)+1;
-       memcpy((char *)(&R_save), (char *)clear, sizeof(R_save));
-       L1 = L_save;
-       R1 = R_save;
-    } else
-#endif
-    {
-       if (clear) {
-           L1 = *((afs_uint32 *)clear);
-            clear=((afs_uint32*)clear)+1;
-       } else
-           L1 = 0;
-       if (clear)
-           R1 = *((afs_uint32 *)clear);
-       else
-           R1 = 0;
-    }
-
-#ifdef DEBUG
-    if (des_debug & 2) {
-       printf("All values printed from low byte (bit 0)");
-       printf(" --> high byte (bit 63)\n");
-       i = 0;
-       dbg_tmp[0] = L1;
-       dbg_tmp[1] = R1;
-       printf("iter = %2d  before IP\n\t\tL1 R1 = ", i);
-       des_cblock_print_file(dbg_tmp, stdout);
-    }
-
-    DBG_PRINT("before IP");
-#endif
-
-/*   IP_start:*/
-
-    /* all the Initial Permutation code is in the include file */
-#include "ip.c"
-    /* reset input to L1,R1 */
-    L1 = L2;
-    R1 = R2;
-
-    /* iterate through the inner loop */
-    for (i = 0; i <= (AUTH_DES_ITER - 1); i++) {
-
-#ifdef DEBUG
-       if (des_debug & 2) {
-           dbg_tmp[0] = L1;
-           dbg_tmp[1] = R1;
-           printf("iter = %2d  start loop\n\t\tL1 R1 = ", i);
-           des_cblock_print_file(dbg_tmp, stdout);
-           DBG_PRINT("start loop");
-       }
-#endif
-
-       R_save = R1;
-       L_save = L1;
-
-/*   E_start:*/
-       /* apply the E permutation from R1 to L2, R2 */
-#ifndef VAXASM
-#ifdef SLOW_E
-#include "e.c"
-#else /* Bill's fast E */
-       L2 = (R1 << 1);
-       if (R1 & (1 << 31))
-           L2 |= 1 << 0;
-       L2 &= 077;
-       L2 |= (R1 << 3) & 07700;
-       L2 |= (R1 << 5) & 0770000;
-       L2 |= (R1 << 7) & 077000000;
-       L2 |= (R1 << 9) & 07700000000;
-       L2 |= (R1 << 11) & 030000000000;
-
-       /* now from right to right */
-
-       R2 = ((R1 >> 17) & 0176000);
-       if (R1 & (1 << 0))
-           R2 |= 1 << 15;
-
-       R2 |= ((R1 >> 21) & 017);
-       R2 |= ((R1 >> 19) & 01760);
-#endif /* SLOW_E */
-#else /* VAXASM */
-       /* E operations */
-       /* right to left */
-       asm("   rotl    $1,r10,r7");
-       L2 &= 077;
-       L2 |= (R1 << 3) & 07700;
-       L2 |= (R1 << 5) & 0770000;
-       L2 |= (R1 << 7) & 077000000;
-       L2 |= (R1 << 9) & 07700000000;
-       L2 |= (R1 << 11) & 030000000000;
-
-       asm("   rotl    $-17,r10,r8");
-       R2 &= 0176000;
-       asm("   rotl    $-21,r10,r0");
-       asm("   bicl2   $-16,r0");
-       asm("  bisl2    r0,r8");
-       asm("   rotl    $-19,r10,r0");
-       asm("   bicl2   $-1009,r0");
-       asm("  bisl2    r0,r8");
-
-#endif
-
-       /* reset input to L1,R1 */
-       L1 = L2;
-       R1 = R2;
-
-#ifdef DEBUG
-       if (des_debug & 2) {
-           dbg_tmp[0] = L1;
-           dbg_tmp[1] = R1;
-           DBG_PRINT("after e");
-           printf("iter = %2d  after e\n\t\tL1 R1 = ", i);
-           des_cblock_print_file(dbg_tmp, stdout);
-       }
-#endif
-
-/*   XOR_start:*/
-       /*
-        * XOR with the key schedule, "schedule"
-        *
-        * If this is an encryption operation, use schedule[i],
-        * otherwise use schedule [AUTH_DES_ITER-i-1]
-        *
-        * First XOR left half.
-        */
-       if (encrypt) {
-           L1 ^= *(((afs_uint32 *) & schedule[i]) + 0);
-           /* now right half */
-           R1 ^= *(((afs_uint32 *) & schedule[i]) + 1);
-       } else {
-           L1 ^= *(((afs_uint32 *) & schedule[AUTH_DES_ITER - i - 1]) + 0);
-           /* now right half */
-           R1 ^= *(((afs_uint32 *) & schedule[AUTH_DES_ITER - i - 1]) + 1);
-       }
-
-       /* dont have to reset input to L1, R1 */
-
-#ifdef DEBUG
-       if (des_debug & 2) {
-           dbg_tmp[0] = L1;
-           dbg_tmp[1] = R1;
-           DBG_PRINT("after xor");
-           printf("iter = %2d  after xor\n\t\tL1 R1 =", i);
-           des_cblock_print_file(dbg_tmp, stdout);
-       }
-#endif
-
-/*   S_start:*/
-       /* apply the S selection from L1, R1 to R2 */
-
-#ifdef notdef
-#include "s.c"
-#endif
-
-       /* S operations , cant use registers for bit field stuff */
-       /* from S_in to S_out */
-
-#ifdef BITS16
-       *S_in_a_16_p = L1 & 0xffff;
-       *S_in_b_16_p = (L1 >> 16) & 0xffff;
-       *S_in_c_16_p = R1 & 0xffff;
-       (*(afs_uint32 *) & S_out) = (unsigned)S_adj[0][S_in_16_a.b0];
-       S_out.b1 = (unsigned)S_adj[1][S_in_16_a.b1];
-       /* b2 spans two words */
-       S_out.b2 = (unsigned)
-           S_adj[2][(unsigned)S_in_16_a.b2 +
-                    (((unsigned)S_in_16_b.b2) << 4)];
-       S_out.b3 = (unsigned)S_adj[3][S_in_16_b.b3];
-       S_out.b4 = (unsigned)S_adj[4][S_in_16_b.b4];
-       /* b5 spans both parts */
-       S_out.b5 = (unsigned)
-           S_adj[5][(unsigned)S_in_16_b.b5 +
-                    (((unsigned)S_in_16_c.b5) << 2)];
-       S_out.b6 = (unsigned)S_adj[6][S_in_16_c.b6];
-       S_out.b7 = (unsigned)S_adj[7][S_in_16_c.b7];
-       R1 = *S_out_p;
-#else
-       /* is a 32 bit sys */
-#ifndef VAXASM
-       R2 = (unsigned)S_adj[0][L1 & 077];
-       L2 = (unsigned)S_adj[1][(L1 >> 6) & 077];
-       R2 |= (L2 << 4);
-       L2 = (unsigned)S_adj[2][(L1 >> 12) & 077];
-       R2 |= (L2 << 8);
-       L2 = (unsigned)S_adj[3][(L1 >> 18) & 077];
-       R2 |= (L2 << 12);
-       L2 = (unsigned)S_adj[4][(L1 >> 24) & 077];
-       R2 |= (L2 << 16);
-       /* b5 spans both parts */
-       L2 = (unsigned)
-           S_adj[5][(unsigned)((L1 >> 30) & 03) + ((R1 & 017) << 2)];
-       R2 |= (L2 << 20);
-       L2 = (unsigned)S_adj[6][(R1 >> 4) & 077];
-       R2 |= (L2 << 24);
-       L2 = (unsigned)S_adj[7][(R1 >> 10) & 077];
-       R1 = R2 | (L2 << 28);
-       /* reset input to L1, R1 */
-#else /* vaxasm */
-       /*
-        * this is the c code produced above, with
-        * extzv replaced by rotl
-        */
-       asm("bicl3      $-64,r9,r0");
-       asm("movzbl     _S_adj[r0],r8");
-       asm("rotl       $-6,r9,r0");
-       asm("bicl2      $-64,r0");
-       asm("movzbl     _S_adj+64[r0],r7");
-       asm("ashl       $4,r7,r0");
-       asm("bisl2      r0,r8");
-       asm("rotl       $-12,r9,r0");
-       asm("bicl2      $-64,r0");
-       asm("movzbl     _S_adj+128[r0],r7");
-       asm("ashl       $8,r7,r0");
-       asm("bisl2      r0,r8");
-       asm("rotl       $-18,r9,r0");
-       asm("bicl2      $-64,r0");
-       asm("movzbl     _S_adj+192[r0],r7");
-       asm("ashl       $12,r7,r0");
-       asm("bisl2      r0,r8");
-       asm("rotl       $-24,r9,r0");
-       asm("bicl2      $-64,r0");
-       asm("movzbl     _S_adj+256[r0],r7");
-       asm("ashl       $16,r7,r0");
-       asm("bisl2      r0,r8");
-       asm("rotl       $-30,r9,r0");
-       asm("bicl2      $-4,r0");
-       asm("bicl3      $-16,r10,r1");
-       asm("ashl       $2,r1,r1");
-       asm("addl2      r1,r0");
-       asm("movzbl     _S_adj+320[r0],r7");
-       asm("ashl       $20,r7,r0");
-       asm("bisl2      r0,r8");
-       asm("rotl       $-4,r10,r0");
-       asm("bicl2      $-64,r0");
-       asm("movzbl     _S_adj+384[r0],r7");
-       asm("ashl       $24,r7,r0");
-       asm("bisl2      r0,r8");
-       asm("rotl       $-10,r10,r0");
-       asm("bicl2      $-64,r0");
-       asm("movzbl     _S_adj+448[r0],r7");
-       asm("ashl       $28,r7,r0");
-       asm("bisl2      r8,r0");
-       asm("movl       r0,r10");
-
-#endif /* vaxasm */
-#endif
-
-#ifdef DEBUG
-       if (des_debug & 2) {
-           dbg_tmp[0] = L1;
-           dbg_tmp[1] = R1;
-           DBG_PRINT("after s");
-           printf("iter = %2d  after s\n\t\tL1 R1 = ", i);
-           des_cblock_print_file(dbg_tmp, stdout);
-       }
-#endif
-
-/*   P_start:*/
-       /* and then the p permutation from R1 into R2 */
-#include "p.c"
-       /* reset the input to L1, R1 */
-       R1 = R2;
-
-#ifdef DEBUG
-       if (des_debug & 2) {
-           dbg_tmp[0] = L1;
-           dbg_tmp[1] = R1;
-           DBG_PRINT("after p");
-           printf("iter = %2d  after p\n\t\tL1 R1 = ", i);
-           des_cblock_print_file(dbg_tmp, stdout);
-       }
-#endif
-
-       /* R1 is the output value from the f() */
-       /* move R[iter] to L[iter+1] */
-/*   XOR_2_start:*/
-       L1 = R_save;
-       /* xor with left */
-       R1 = L_save ^ R1;
-       /* reset the input */
-    }
-
-    /* flip left and right before final permutation */
-    L2 = R1;                   /* flip */
-    R2 = L1;
-    /* reset the input */
-    L1 = L2;
-    R1 = R2;
-
-#ifdef DEBUG
-    if (des_debug & 2) {
-       dbg_tmp[0] = L1;
-       dbg_tmp[1] = R1;
-       DBG_PRINT("before FP");
-       printf("iter = %2d  before FP\n\t\tL1 R1 = ", i);
-       des_cblock_print_file(dbg_tmp, stdout);
-    }
-#endif
-
-/*FP_start:*/
-    /* do the final permutation from L1R1 to L2R2 */
-    /* all the fp code is in the include file */
-#include "fp.c"
-
-    /* copy the output to the ciphertext string;
-     * can be same as cleartext
-     */
-
-#ifdef MUSTALIGN
-    if (afs_pointer_to_int(cipher) & 3) {
-       L_save = L2;            /* cant bcopy a reg */
-       R_save = R2;
-       memcpy((char *)cipher, (char *)&L_save, sizeof(L_save));
-       cipher=((afs_uint32*)cipher)+1;
-       memcpy((char *)cipher, (char *)&R_save, sizeof(R_save));
-    } else
-#endif
-    {
-        *((afs_uint32*)cipher)= L2;
-       cipher = ((afs_int32 *)cipher)+1;
-       *((afs_uint32 *)cipher) = R2;
-    }
-
-#ifdef DEBUG
-    if (des_debug & 2) {
-       L1 = L2;
-       R1 = R2;
-       dbg_tmp[0] = L1;
-       dbg_tmp[1] = R1;
-       DBG_PRINT("done");
-       printf("iter = %2d  done\n\t\tL1 R1 = ", i);
-       des_cblock_print_file(dbg_tmp, stdout);
-    }
-#endif
-
-    /* that's it, no errors can be returned */
-    return 0;
-}
diff --git a/src/des/des.h b/src/des/des.h
deleted file mode 100644 (file)
index 747caad..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * Include file for the Data Encryption Standard library.
- */
-
-/* only do the whole thing once         */
-#ifndef DES_DEFS
-#define DES_DEFS
-
-#include "mit-cpyright.h"
-
-typedef unsigned char des_cblock[8];   /* crypto-block size */
-/* Key schedule */
-typedef struct des_ks_struct {
-    union {
-    afs_uint32 i[2];
-    des_cblock _;
-    } _;
-} des_key_schedule[16];
-
-#define DES_KEY_SZ     (sizeof(des_cblock))
-#define DES_ENCRYPT    1
-#define DES_DECRYPT    0
-
-#ifndef NCOMPAT
-#define C_Block des_cblock
-#define Key_schedule des_key_schedule
-#ifndef ENCRYPT
-#define ENCRYPT DES_ENCRYPT
-#define DECRYPT DES_DECRYPT
-#endif
-#define KEY_SZ DES_KEY_SZ
-#define string_to_key des_string_to_key
-#define read_pw_string des_read_pw_string
-#define random_key des_random_key
-#define pcbc_encrypt des_pcbc_encrypt
-#ifdef AFS_DUX40_ENV
-/* This is done to avoid name space collision with dtlogin and SIA. */
-#define des_key_sched afs_des_key_sched
-#endif
-#define key_sched des_key_sched
-#define cbc_encrypt des_cbc_encrypt
-#define ecb_encrypt des_ecb_encrypt
-#define cbc_cksum des_cbc_cksum
-#define C_Block_print des_cblock_print
-#define quad_cksum des_quad_cksum
-typedef struct des_ks_struct bit_64;
-#endif
-
-#define des_cblock_print(x) des_cblock_print_file(x, stdout)
-
-#endif /* DES_DEFS */
diff --git a/src/des/des_conf.h b/src/des/des_conf.h
deleted file mode 100644 (file)
index e23746b..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * This file contains configuration information for the DES library
- * which is machine specific; currently, this file contains
- * configuration information for the vax, the "ibm032" (RT), and
- * the "PC8086" (IBM PC).
- *
- * Note:  cross-compiled targets must appear BEFORE their corresponding
- * cross-compiler host.  Otherwise, both will be defined when running
- * the native compiler on the programs that construct cross-compiled
- * sources.
- */
-
-#include <afs/param.h>
-#include <mit-cpyright.h>
-
-/* Machine-type and OS-type based configuration */
-
-#ifdef PC8086
-#define IBMPC
-#define BITS16
-/* #define BIG */
-#define CROSSMSDOS
-#define LSBFIRST
-
-#else
-
-#ifdef vax
-#define VAX
-#ifndef        __STDC__                /* not Berkeley PCC */
-#ifndef        __GNU__                 /* ditto */
-#ifndef        NOASM                   /* are we doing C-only? */
-#define VAXASM
-#endif /* NOASM */
-#endif /* __GNU__ */
-#endif /* __STDC__ */
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define LSBFIRST
-
-#else
-
-#ifdef sun
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define MSBFIRST
-
-#else
-
-#ifdef AFS_AIX_ENV
-#define IBMWS
-#define IBMWSASM
-#define BITS32
-#define BIG
-#define        BSDUNIX                 /*Does it mean the default us S5? NO */
-#define MSBFIRST
-#define MUSTALIGN
-#else
-#ifdef multimax
-#define BITS32
-#define BIG
-#define BSDUNIX
-#define LSBFIRST
-#else
-
-Sorry,
-    you lose.
-    Figure out what the machine looks like and fix this file to include it.
-#endif /* multimax */
-#endif /* AFS_AIX_ENV */
-#endif /* sun */
-#endif /* vax */
-#endif /* pc8086 */
-/* Language configuration -- are we ANSI or are we Berkeley? */
-#ifndef        __STDC__
-#define        const
-#endif
diff --git a/src/des/des_internal.h b/src/des/des_internal.h
deleted file mode 100644 (file)
index 4295a41..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * Private include file for the Data Encryption Standard library.
- */
-
-/* only do the whole thing once         */
-#ifndef DES_INTERNAL_DEFS
-#define DES_INTERNAL_DEFS
-
-#include "conf.h"
-
-/*
- * number of iterations of the inner
- * loop of the DES algorithm.  The
- * standard is 16, but in case that is
- * too slow, we might do less.  Of
- * course, less also means less
- * security.
- */
-#define         AUTH_DES_ITER   16
-
-#ifdef  BITS32
-/* these are for 32 bit machines */
-
-typedef struct {
-    unsigned b0:6;
-    unsigned b1:6;
-    unsigned b2:6;
-    unsigned b3:6;
-    unsigned b4:6;
-    unsigned b5:2;
-} sbox_in_a;
-
-typedef struct {
-    unsigned b5:4;
-    unsigned b6:6;
-    unsigned b7:6;
-} sbox_in_b;
-
-typedef struct {
-    unsigned b0:4;
-    unsigned b1:4;
-    unsigned b2:4;
-    unsigned b3:4;
-    unsigned b4:4;
-    unsigned b5:4;
-    unsigned b6:4;
-    unsigned b7:4;
-} sbox_out;
-
-#else /* BITS32 */
-/* for sixteen bit machines */
-
-typedef struct {
-    unsigned b0:6;
-    unsigned b1:6;
-    unsigned b2:4;
-} sbox_in_16_a;
-
-typedef struct {
-    unsigned b2:2;
-    unsigned b3:6;
-    unsigned b4:6;
-    unsigned b5:2;
-} sbox_in_16_b;
-
-typedef struct {
-    unsigned b5:4;
-    unsigned b6:6;
-    unsigned b7:6;
-} sbox_in_16_c;
-
-typedef struct {
-    unsigned b0:4;
-    unsigned b1:4;
-    unsigned b2:4;
-    unsigned b3:4;
-    unsigned b4:4;
-    unsigned b5:4;
-    unsigned b6:4;
-    unsigned b7:4;
-} sbox_out;
-#endif /* BITS32 */
-
-
-#endif /* DES_INTERNAL_DEFS */
diff --git a/src/des/des_prototypes.h b/src/des/des_prototypes.h
deleted file mode 100644 (file)
index 9c5e62c..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef DES_PROTOTYPES_H
-#define DES_PROTOTYPES_H
-
-/* misc.c */
-extern afs_uint32 long_swap_bits(afs_uint32 x);
-extern afs_uint32 swap_six_bits_to_ansi(afs_uint32 old);
-extern afs_uint32 swap_four_bits_to_ansi(afs_uint32 old);
-extern afs_uint32 swap_bit_pos_1(afs_uint32 x);
-extern afs_uint32 swap_bit_pos_0(afs_uint32 x);
-extern afs_uint32 swap_bit_pos_0_to_ansi(afs_uint32 x);
-extern afs_uint32 rev_swap_bit_pos_0(afs_uint32 x);
-extern afs_uint32 swap_byte_bits(afs_uint32 x);
-extern int swap_long_bytes_bit_number(afs_uint32 x);
-#if !defined(KERNEL)
-extern void test_set(FILE * stream, const char *src, int testbit,
-                    const char *dest, int setbit);
-#endif
-extern int des_debug;
-
-static_inline unsigned char *
-cblockptr_to_cblock(des_cblock *key) {
-    return (unsigned char *)key;
-}
-
-static_inline unsigned char *
-charptr_to_cblock(char *key) {
-    return (unsigned char *)key;
-}
-
-static_inline des_cblock *
-charptr_to_cblockptr(char *key) {
-    return (unsigned char (*)[])key;
-}
-
-/* cbc_encrypt.c */
-extern afs_int32 des_cbc_encrypt(void * in, void * out,
-                                afs_int32 length,
-                                des_key_schedule key, des_cblock * iv,
-                                int encrypt);
-
-/* pcbc_encrypt.c */
-extern afs_int32 des_pcbc_encrypt(void * in, void * out,
-                                 afs_int32 length,
-                                 des_key_schedule key, des_cblock * iv,
-                                 int encrypt);
-
-/* des.c */
-extern afs_int32 des_ecb_encrypt(void * clear, void * cipher,
-                                des_key_schedule schedule,
-                                int encrypt);
-
-/* util.c */
-#if !defined(KERNEL)
-extern int des_cblock_print_file(des_cblock * x, FILE * fp);
-#endif
-
-/* make_*.c */
-#if !defined(KERNEL)
-extern void gen(FILE * stream);
-#endif
-
-/* weak_key.c */
-extern int des_is_weak_key(des_cblock key);
-
-/* key_parity.c */
-extern void des_fixup_key_parity(des_cblock key);
-extern int des_check_key_parity(des_cblock key);
-
-/* cksum.c */
-extern afs_uint32 des_cbc_cksum(des_cblock * in, des_cblock * out,
-                               afs_int32 length,
-                               des_key_schedule key, des_cblock * iv);
-
-/* quad_cksum.c */
-extern afs_uint32 des_quad_cksum(unsigned char *in, afs_uint32 * out,
-                                afs_int32 length, int out_count,
-                                des_cblock * c_seed);
-
-/* key_sched.c */
-extern int afs_des_key_sched(des_cblock k,
-                            des_key_schedule schedule);
-extern int des_key_sched(des_cblock k, des_key_schedule schedule);
-
-
-/* strng_to_key.c */
-extern void des_string_to_key(char *str, des_cblock * key);
-
-/* new_rnd_key.c */
-extern int des_random_key(des_cblock key);
-extern void des_init_random_number_generator(des_cblock key);
-extern void des_set_random_generator_seed(des_cblock key);
-
-/* read_pssword.c */
-extern int des_read_password(des_cblock * k, char *prompt, int verify);
-extern int des_read_pw_string(char *, int, char *, int);
-
-#endif
diff --git a/src/des/enc.c b/src/des/enc.c
deleted file mode 100644 (file)
index 72687b1..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include "des.h"
-#ifdef BSDUNIX
-#include <sys/file.h>
-#endif
-#include <stdio.h>
-
-Key_schedule KEYSCHED;
-C_Block key = { 0, 1, 2, 3, 4, 5, 6, 7 };
-C_Block sum;
-char inbuf[512 + 8];           /* leave room for cksum and len */
-char oubuf[512 + 8];
-int debug;
-int ind;
-int oud;
-afs_int32 orig_size;
-
-#include "AFS_component_version_number.c"
-
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-    int encrypt;
-    afs_int32 length;
-    int *p;
-    afs_int32 ivec[2];
-    if (argc != 4) {
-       fprintf(stderr, "%s: Usage: %s infile outfile mode.\n", argv[0],
-               argv[0]);
-       exit(1);
-    }
-    if (!strcmp(argv[3], "e"))
-       encrypt = 1;
-    else if (!strcmp(argv[3], "d"))
-       encrypt = 0;
-    else {
-       fprintf(stderr, "%s: Mode must be e (encrypt) or d (decrypt).\n",
-               argv[0]);
-       exit(1);
-    }
-    if ((ind = open(argv[1], O_RDONLY, 0666)) < 0) {
-       fprintf(stderr, "%s: Cannot open %s for input.\n", argv[0], argv[1]);
-       exit(1);
-    }
-    if (!strcmp(argv[2], "-"))
-       oud = dup(1);
-    else if ((oud = open(argv[2], O_CREAT | O_WRONLY, 0666)) < 0) {
-       fprintf(stderr, "%s: Cannot open %s for output.\n", argv[0], argv[2]);
-       exit(1);
-    }
-#ifdef notdef
-    (void)freopen("/dev/tty", "r", stdin);
-    (void)freopen("/dev/tty", "w", stdout);
-#endif
-    read_password(key, "\n\07\07Enter Key> ", 1);
-    if (key_sched(key, KEYSCHED) < 0) {
-       fprintf(stderr, "%s: Key parity error\n", argv[0]);
-       exit(1);
-    }
-    ivec[0] = 0;
-    ivec[1] = 0;
-    memcpy(sum, key, sizeof(C_Block));
-    for (;;) {
-       if ((length = read(ind, inbuf, 512)) < 0) {
-           fprintf(stderr, "%s: Error reading from input.\n", argv[0]);
-           exit(1);
-       } else if (length == 0) {
-           fprintf(stderr, "\n");
-           break;
-       }
-       if (encrypt) {
-#ifdef notdef
-           sum = quad_cksum(inbuf, NULL, length, 1, sum);
-#endif
-           quad_cksum(inbuf, sum, length, 1, sum);
-           orig_size += length;
-           fprintf(stderr, "\nlength = %d tot length = %d quad_sum = %X %X",
-                   length, orig_size, *(afs_uint32 *) sum,
-                   *((afs_uint32 *) sum + 1));
-           fflush(stderr);
-       }
-       pcbc_encrypt(inbuf, oubuf, (afs_int32) length, KEYSCHED, ivec,
-                    encrypt);
-       if (!encrypt) {
-#ifdef notdef
-           sum = quad_cksum(oubuf, NULL, length, 1, sum);
-#endif
-           quad_cksum(oubuf, sum, length, 1, sum);
-           orig_size += length;
-           fprintf(stderr, "\nlength = %d tot length = %d quad_sum = %X ",
-                   length, orig_size, *(afs_uint32 *) sum,
-                   *((afs_uint32 *) sum + 1));
-       }
-       length = (length + 7) & ~07;
-       write(oud, oubuf, length);
-       if (!encrypt)
-           p = (int *)&oubuf[length - 8];
-       else
-           p = (int *)&inbuf[length - 8];
-       ivec[0] = *p++;
-       ivec[1] = *p;
-    }
-
-    fprintf(stderr, "\ntot length = %d quad_sum = %X\n", orig_size, sum);
-    /* if encrypting, now put the original length and checksum in */
-}
diff --git a/src/des/key_parity.c b/src/des/key_parity.c
deleted file mode 100644 (file)
index fbfb383..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 1989 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * These routines check and fix parity of encryption keys for the DES
- * algorithm.
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * These routines form the library interface to the DES facilities.
- *
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#include "odd.h"               /* Load compile-time generated odd_parity table */
-
-/*
- * des_fixup_key_parity: Forces odd parity per byte; parity is bits
- *                       8,16,...64 in des order, implies 0, 8, 16, ...
- *                       vax order.
- */
-void
-des_fixup_key_parity(des_cblock key)
-{
-    int i;
-
-    for (i = 0; i < sizeof(des_cblock); i++)
-       key[i] = odd_parity[key[i]];
-
-    return;
-}
-
-/*
- * des_check_key_parity: returns true iff key has the correct des parity.
- *                       See des_fix_key_parity for the definition of
- *                       correct des parity.
- */
-int
-des_check_key_parity(des_cblock key)
-{
-    int i;
-
-    for (i = 0; i < sizeof(des_cblock); i++)
-       if (key[i] != odd_parity[key[i]])
-           return (0);
-
-    return (1);
-}
diff --git a/src/des/key_sched.c b/src/des/key_sched.c
deleted file mode 100644 (file)
index d856914..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * This routine computes the DES key schedule given a key.  The
- * permutations and shifts have been done at compile time, resulting
- * in a direct one-step mapping from the input key to the key
- * schedule.
- *
- * Also checks parity and weak keys.
- *
- * Watch out for the subscripts -- most effectively start at 1 instead
- * of at zero.  Maybe some bugs in that area.
- *
- * DON'T change the data types for arrays and such, or it will either
- * break or run slower.  This was optimized for Uvax2.
- *
- * In case the user wants to cache the computed key schedule, it is
- * passed as an arg.  Also implies that caller has explicit control
- * over zeroing both the key schedule and the key.
- *
- * All registers labeled imply Vax using the Ultrix or 4.2bsd compiler.
- *
- * Originally written 6/85 by Steve Miller, MIT Project Athena.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include "des_internal.h"
-#include <stdio.h>
-
-#include "des.h"
-#include "key_perm.h"
-#include "des_prototypes.h"
-
-typedef char key[64];
-
-/* the following are really void but cc86 doesnt allow it */
-static int make_key_sched(key Key, des_key_schedule Schedule);
-
-#ifdef AFS_DUX40_ENV
-#pragma weak des_key_sched = afs_des_key_sched
-int
-afs_des_key_sched(des_cblock k, des_key_schedule schedule)
-#else
-int
-des_key_sched(des_cblock k, des_key_schedule schedule)
-#endif
-{
-    /* better pass 8 bytes, length not checked here */
-
-    int i, j, n;       /* i = r10, j = r9, n = r8 */
-    unsigned int temp; /*  r7 */
-    char *p_char;      /* r6 */
-    key k_char;
-    i = 8;
-    n = 0;
-    p_char = k_char;
-
-#ifdef lint
-    n = n;                     /* fool it in case of VAXASM */
-#endif
-#ifdef DEBUG
-    if (des_debug)
-       fprintf(stderr, "\n\ninput key, left to right = ");
-#endif
-
-    if (!des_check_key_parity(k))      /* bad parity --> return -1 */
-       return (-1);
-
-    do {
-       /* get next input key byte */
-#ifdef DEBUG
-       if (des_debug)
-           fprintf(stderr, "%02x ", *k & 0xff);
-#endif
-       temp = (unsigned int)((unsigned char)*k++);
-       j = 8;
-
-       do {
-#ifndef VAXASM
-           *p_char++ = (int)temp & 01;
-           temp = temp >> 1;
-#else
-           asm("bicb3  $-2,r7,(r8)+[r6]");
-           asm("rotl   $-1,r7,r7");
-#endif
-       } while (--j > 0);
-    } while (--i > 0);
-
-#ifdef DEBUG
-    if (des_debug) {
-       p_char = k_char;
-       fprintf(stderr, "\nKey bits, from zero to 63");
-       for (i = 0; i <= 7; i++) {
-           fprintf(stderr, "\n\t");
-           for (j = 0; j <= 7; j++)
-               fprintf(stderr, "%d ", *p_char++);
-       }
-    }
-#else
-#ifdef lint
-    p_char = p_char;
-#endif
-#endif
-
-    /* check against weak keys */
-    k -= sizeof(des_cblock);
-
-    if (des_is_weak_key(k))
-       return (-2);
-
-    make_key_sched(k_char, schedule);
-
-    /* if key was good, return 0 */
-    return 0;
-}
-
-static int
-make_key_sched(key Key, des_key_schedule Schedule)
-{
-    /*
-     * The key has been converted to an array to make this run faster;
-     * on a microvax 2, this routine takes about 3.5ms.  The code and
-     * size of the arrays has been played with to get it as fast as
-     * possible.
-     *
-     * Don't change the order of the declarations below without
-     * checking the assembler code to make sure that things are still
-     * where it expects them.
-     */
-
-    /* r10, unroll by AUTH_DES_ITER */
-    int iter = AUTH_DES_ITER;
-    afs_uint32 *k;     /* r9 */
-    int *kp;           /* r8 */
-    afs_uint32 temp;   /* r7 */
-
-    kp = (int *)key_perm;
-    k = (afs_uint32 *) Schedule;
-
-    do {
-       /*
-        * create the Key schedule
-        *
-        * put into lsb first order (lsb is bit 0)
-        */
-
-       /*
-        * On the uvax2, this C code below is as fast as straight
-        * assembler, so just use C code below.
-        */
-       temp = 0;
-#ifdef LSBFIRST
-#define BIT(x) x
-#else
-#ifdef notdef
-#define BIT(x) rev_swap_bit_pos_0(x)
-#else
-#define BIT(x) x
-#endif
-#endif
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(0));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(1));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(2));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(3));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(4));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(5));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(6));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(7));
-
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(8));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(9));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(10));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(11));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(12));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(13));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(14));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(15));
-
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(16));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(17));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(18));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(19));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(20));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(21));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(22));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(23));
-
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(24));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(25));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(26));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(27));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(28));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(29));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(30));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(31));
-
-       *k++ = temp;
-       temp = 0;
-
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(0));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(1));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(2));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(3));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(4));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(5));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(6));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(7));
-
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(8));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(9));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(10));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(11));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(12));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(13));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(14));
-       if ((unsigned)Key[(int)*kp++])
-           temp |= (1 << BIT(15));
-
-       *k++ = temp;
-
-    } while (--iter > 0);
-
-#ifdef DEBUG
-    if (des_debug) {
-       int i;
-       char *n;
-       int q;
-       fprintf(stderr, "\nKey Schedule, left to right");
-       for (i = 0; i < AUTH_DES_ITER; i++) {
-           n = (char *)&Schedule[i];
-           fprintf(stderr, "\n");
-           for (q = 0; q <= 7; q++)
-               fprintf(stderr, "%02x ", *n++ & 0xff);
-       }
-       fprintf(stderr, "\n");
-    }
-#endif
-
-    return (0);
-}
diff --git a/src/des/main.c b/src/des/main.c
deleted file mode 100644 (file)
index 132c4c6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information,
- * please seethe file <mit-cpyright.h>.
- *
- * This file contains most of the routines needed by the various
- * make_foo programs, to account for bit- and byte-ordering on
- * different machine types.  It also contains other routines useful in
- * generating the intermediate source files.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-char const *whoami;
-
-#ifndef DONT_INCL_MAIN
-
-#include "AFS_component_version_number.c"
-
-int
-main(int argc, char *argv[])
-{
-    char *filename;
-    char *arg;
-    FILE *stream;
-
-    whoami = argv[0];
-    filename = (char *)NULL;
-
-    while (argc--, *++argv) {
-       arg = *argv;
-       if (*arg == '-') {
-           if (!strcmp(arg, "-d") && !strcmp(arg, "-debug"))
-               des_debug++;
-           else {
-               fprintf(stderr, "%s: unknown control argument %s\n", whoami,
-                       arg);
-               goto usage;
-           }
-       } else if (filename) {
-           fprintf(stderr, "%s: multiple file names provided: %s, %s\n",
-                   whoami, filename, arg);
-           goto usage;
-       } else
-           filename = arg;
-    }
-
-    if (!filename) {
-       fprintf(stderr, "%s: no file name provided\n", whoami);
-       goto usage;
-    }
-
-    stream = fopen(filename, "w");
-    if (!stream) {
-       perror(filename);
-      usage:
-       fprintf(stderr, "usage: %s [-debug] filename\n", whoami);
-       exit(1);
-    }
-
-    fputs("/* This file is automatically generated.  Do not edit it. */\n",
-         stream);
-
-    /* This routine will generate the contents of the file. */
-    gen(stream);
-    if (fclose(stream) == EOF) {
-       perror(filename);
-       exit(1);
-    }
-    exit(0);
-}
-#endif /* DONT_INCL_MAIN */
diff --git a/src/des/make_e.c b/src/des/make_e.c
deleted file mode 100644 (file)
index 01c91e1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Part of the MIT Project Athena Kerberos encryption system,
- * originally written 8/85 by Steve Miller.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "tables.h"
-
-#include "AFS_component_version_number.c"
-
-main()
-{
-    int i;
-
-    /* clear the output */
-    fprintf(stdout, "\n\tL2 = 0; R2 = 0;");
-
-    /* only take bits from R1, put into either L2 or R2 */
-    /* first setup E */
-    fprintf(stdout, "\n/* E operations */\n/* right to left */\n");
-    /* first list mapping from left to left */
-
-    for (i = 0; i <= 31; i++)
-       if (E[i] < 32)
-           fprintf(stdout, "\n\tif (R1 & (1<<%d)) L2 |= 1<<%d;", E[i], i);
-
-    fprintf(stdout, "\n\n/* now from right to right */\n");
-    /*  list mapping from left to right */
-    for (i = 32; i <= 47; i++)
-       if (E[i] < 32)
-           fprintf(stdout, "\n\tif (R1 & (1<<%d)) R2 |= 1<<%d;", E[i],
-                   i - 32);
-
-    fprintf(stdout, "\n");
-}
diff --git a/src/des/make_fp.c b/src/des/make_fp.c
deleted file mode 100644 (file)
index b91ed87..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information,
- * please see the file <mit-cpyright.h>.
- *
- * This file contains a generation routine for source code
- * implementing the final permutation of the DES.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#define WANT_FP_TABLE
-#include "tables.h"
-
-void
-gen(FILE * stream)
-{
-    int i;
-#ifdef AFS_DARWIN80_ENV
-    int j;
-
-#define swap_long_bytes_bit_number _darwin_swap_long_bytes_bit_number
-#endif /* AFS_DARWIN80_ENV */
-
-    /* clear the output */
-    fprintf(stream, "    L2 = 0; R2 = 0;\n");
-
-    /*
-     *  NOTE: As part of the final permutation, we also have to adjust
-     *  for host bit order via "swap_bit_pos_0()".  Since L2,R2 are
-     *  the output from this, we adjust the bit positions written into
-     *  L2,R2.
-     */
-
-#define SWAP(i,j) \
-    swap_long_bytes_bit_number(swap_bit_pos_0_to_ansi((unsigned)i)-j)
-
-#ifdef AFS_DARWIN80_ENV
-  for(j = 0;; j++) {
-    fprintf(stream, "%s", _darwin_whichstr[j]);
-    if (j == 2)
-       break;
-#endif /* AFS_DARWIN80_ENV */
-    /* first setup FP */
-    fprintf(stream, "/* FP operations */\n/* first left to left */\n");
-
-    /* first list mapping from left to left */
-    for (i = 0; i <= 31; i++)
-       if (FP[i] < 32)
-           test_set(stream, "L1", FP[i], "L2", SWAP(i, 0));
-
-    /* now mapping from right to left */
-    fprintf(stream, "\n\n/* now from right to left */\n");
-    for (i = 0; i <= 31; i++)
-       if (FP[i] >= 32)
-           test_set(stream, "R1", FP[i] - 32, "L2", SWAP(i, 0));
-
-    fprintf(stream, "\n/* now from left to right */\n");
-
-    /*  list mapping from left to right */
-    for (i = 32; i <= 63; i++)
-       if (FP[i] < 32)
-           test_set(stream, "L1", FP[i], "R2", SWAP(i, 32));
-
-    /* now mapping from right to right */
-    fprintf(stream, "\n/* last from right to right */\n");
-    for (i = 32; i <= 63; i++)
-       if (FP[i] >= 32)
-           test_set(stream, "R1", FP[i] - 32, "R2", SWAP(i, 32));
-#ifdef AFS_DARWIN80_ENV
-    _darwin_which = !_darwin_which;
-  }
-#endif /* AFS_DARWIN80_ENV */
-}
diff --git a/src/des/make_ip.c b/src/des/make_ip.c
deleted file mode 100644 (file)
index c923655..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * This routine generates source code implementing the initial
- * permutation of the DES.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "des.h"
-#include "des_internal.h"
-
-#define WANT_IP_TABLE
-#include "tables.h"
-
-#include "des_prototypes.h"
-
-#define SWAP(x) swap_long_bytes_bit_number(swap_bit_pos_0_to_ansi(x))
-
-void
-gen(FILE * stream)
-{
-    int i;
-#ifdef AFS_DARWIN80_ENV
-    int j;
-
-#define swap_long_bytes_bit_number _darwin_swap_long_bytes_bit_number
-#endif /* AFS_DARWIN80_ENV */
-
-    /* clear the output */
-    fprintf(stream, "    L2 = 0; R2 = 0;\n");
-
-#ifdef AFS_DARWIN80_ENV
-  for(j = 0;; j++) {
-    fprintf(stream, "%s", _darwin_whichstr[j]);
-    if (j == 2)
-       break;
-#endif /* AFS_DARWIN80_ENV */
-    /* first setup IP */
-    fprintf(stream, "/* IP operations */\n/* first left to left */\n");
-
-    /* first list mapping from left to left */
-    for (i = 0; i <= 31; i++)
-       if (IP[i] < 32)
-           test_set(stream, "L1", SWAP(IP[i]), "L2", i);
-
-    /* now mapping from right to left */
-    fprintf(stream, "\n/* now from right to left */\n");
-    for (i = 0; i <= 31; i++)
-       if (IP[i] >= 32)
-           test_set(stream, "R1", SWAP(IP[i] - 32), "L2", i);
-
-    fprintf(stream, "\n/* now from left to right */\n");
-    /*  list mapping from left to right */
-    for (i = 32; i <= 63; i++)
-       if (IP[i] < 32)
-           test_set(stream, "L1", SWAP(IP[i]), "R2", i - 32);
-
-    /* now mapping from right to right */
-    fprintf(stream, "\n/* last from right to right */\n");
-    for (i = 32; i <= 63; i++)
-       if (IP[i] >= 32)
-           test_set(stream, "R1", SWAP(IP[i] - 32), "R2", i - 32);
-#ifdef AFS_DARWIN80_ENV
-    _darwin_which = !_darwin_which;
-  }
-#endif /* AFS_DARWIN80_ENV */
-    exit(0);
-}
diff --git a/src/des/make_keyperm.c b/src/des/make_keyperm.c
deleted file mode 100644 (file)
index 1e4f35b..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * This routine calculates an effective Key schedule set of
- * permutations for des.  Beginning with the pre-defined key schedule
- * algorithm, it reduces it to a set of 16 permutations upon the
- * initial key.  Only needs to execute once to produce a header file.
- * Note that we subtract one from the values ouput to fix up for C
- * subscripts starting at 0.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include <errno.h>
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-char *progname;
-
-static int key_position[64 + 1];
-static int C[28 + 1];
-static int D[28 + 1];
-static int C_temp, D_temp;
-
-/*
- *  CONVENTIONS for numbering the bits
- *  bit 0 ==> lsb
- *  L starts at bit 0
- *  R starts at bit 64
- *
- *  BEWARE-- some stuff starts at 0, some at 1;  perhaps some bugs still?
- */
-
-/*
- * Sequence of shifts used for the key schedule.
- */
-static int const shift[16 + 1] = { 0,
-    1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1,
-};
-
-static int const pc_1[56 + 1] = { 0,
-
-    57, 49, 41, 33, 25, 17, 9,
-    1, 58, 50, 42, 34, 26, 18,
-    10, 2, 59, 51, 43, 35, 27,
-    19, 11, 3, 60, 52, 44, 36,
-
-    63, 55, 47, 39, 31, 23, 15,
-    7, 62, 54, 46, 38, 30, 22,
-    14, 6, 61, 53, 45, 37, 29,
-    21, 13, 5, 28, 20, 12, 4,
-};
-
-
-/*
- * Permuted-choice 2, to pick out the bits from
- * the CD array that generate the key schedule.
- */
-static int const pc_2[48 + 1] = { 0,
-
-    14, 17, 11, 24, 1, 5,
-    3, 28, 15, 6, 21, 10,
-    23, 19, 12, 4, 26, 8,
-    16, 7, 27, 20, 13, 2,
-
-    41, 52, 31, 37, 47, 55,
-    30, 40, 51, 45, 33, 48,
-    44, 49, 39, 56, 34, 53,
-    46, 42, 50, 36, 29, 32,
-};
-
-static int ks_perm[16 + 1][48 + 1];
-
-int des_debug;
-
-void
-gen(FILE * stream)
-{
-    /*  Local Declarations */
-    int i, j, iter;
-
-    /*
-     * initialize the key_position array s.t. key_position[i] = i;
-     * that is, each element is equal to its starting position.
-     *
-     * Also adjust for the bit order within bytes.
-     */
-
-    for (i = 0; i < 65; i++)
-       key_position[i] = swap_bit_pos_1(i);
-
-    fprintf(stream, "static int const key_perm[16][48] = {\n");
-
-    /*
-     * apply pc_1 to initial key_position to create C[0] and D[0]
-     * Start at pc_1[1], not pc_1[0]
-     */
-    for (i = 1; i <= 28; i++) {
-       C[i] = key_position[pc_1[i]];
-       D[i] = key_position[pc_1[i + 28]];
-    }
-
-    /*
-     * major loop over the 16 iterations
-     * start at iter = 1, not zero.
-     */
-    for (iter = 1; iter <= 16; iter++) {
-       if (des_debug) {
-           /*  for debugging */
-           printf("/* DEBUG-- start iteration = %d  shifts = %d", iter,
-                  shift[iter]);
-           printf("\nC array");
-           for (i = 1; i <= 4; i++) {
-               printf("\n");
-               for (j = 1; j <= 7; j++)
-                   printf("%d, ", C[(i - 1) * 7 + j]);
-           }
-           printf("\n\nD array");
-           for (i = 1; i <= 4; i++) {
-               printf("\n");
-               for (j = 1; j <= 7; j++)
-                   printf("%d, ", D[(i - 1) * 7 + j]);
-           }
-           printf("\n */");
-           fflush(stdout);
-       }
-
-       /* apply the appropriate left shifts */
-       for (i = 1; i <= shift[iter]; i++) {
-           C_temp = C[1];
-           D_temp = D[1];
-           for (j = 1; j <= 27; j++) {
-               C[j] = C[j + 1];
-               D[j] = D[j + 1];
-           }
-           C[j] = C_temp;
-           D[j] = D_temp;
-       }
-
-
-       if (des_debug) {
-           /* for debugging */
-           printf("/* DEBUG:\n");
-           printf(" * after shifts, iteration = %d  shifts = %d", iter,
-                  shift[iter]);
-           printf("\nC array");
-           for (i = 1; i <= 4; i++) {
-               printf("\n");
-               for (j = 1; j <= 7; j++)
-                   printf("%d, ", C[(i - 1) * 7 + j]);
-           }
-           printf("\n\nD array");
-           for (i = 1; i <= 4; i++) {
-               printf("\n");
-               for (j = 1; j <= 7; j++)
-                   printf("%d, ", D[(i - 1) * 7 + j]);
-           }
-           printf("\n */");
-           fflush(stdout);
-       }
-
-       /*
-        * apply pc_2
-        * Start at pc_2[1], not pc_2[0]
-        *
-        * Start stuffing ks_perm[1][1], not ks_perm[0][0]
-        *
-        * Adjust ks_perm for bit order if needed.
-        */
-       for (i = 1; i <= 48; i++) {
-           if (pc_2[i] <= 28)
-               ks_perm[iter][(i)] = C[pc_2[i]];
-           else
-               ks_perm[iter][(i)] = D[pc_2[i] - 28];
-       }
-
-       /* now output the resulting key permutation */
-       fprintf(stream, "\n    /* ks permutation iteration = %2d */", iter);
-       for (i = 1; i <= 6; i++) {
-           if (i == 1)
-               fprintf(stream, "\n    {");
-           fprintf(stream, "\n    ");
-           for (j = 1; j <= 8; j++) {
-               /*
-                * IMPORTANT -- subtract one from value to adjust to a
-                * zero-based subscript for key
-                */
-               fprintf(stream, "%d", ks_perm[iter][(i - 1) * 8 + j] - 1);
-               /* omit last comma */
-               if ((j != 8) || (i != 6)) {
-                   fprintf(stream, ", ");
-               }
-           }
-       }
-       if (iter != 16) {
-           fprintf(stream, "\n    }, ");
-       } else {
-           fprintf(stream, "\n    }");
-       }
-    }
-    fprintf(stream, "\n};\n");
-}
diff --git a/src/des/make_odd.c b/src/des/make_odd.c
deleted file mode 100644 (file)
index 10ebe99..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see
- * the file <mit-cpyright.h>.
- *
- * This routine generates an odd-parity table for use in key generation.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-
-void
-gen(FILE *stream)
-{
-    /*
-     * map a byte into its equivalent with odd parity, where odd
-     * parity is in the least significant bit
-     */
-    int i, j, k, odd;
-
-    fprintf(stream, "static unsigned char const odd_parity[256] = {\n");
-
-    for (i = 0; i < 256; i++) {
-       odd = 0;
-       /* shift out the lsb parity bit */
-       k = i >> 1;
-       /* then count the other bits */
-       for (j = 0; j < 7; j++) {
-           odd ^= (k & 1);
-           k = k >> 1;
-       }
-       k = i & ~1;
-       if (!odd)
-           k |= 1;
-       fprintf(stream, "%3d", k);
-       if (i < 255)
-           fprintf(stream, ", ");
-       if (i % 8 == 0)
-           fprintf(stream, "\n");
-    }
-    fprintf(stream, "};\n");
-}
diff --git a/src/des/make_p.c b/src/des/make_p.c
deleted file mode 100644 (file)
index 9dc9545..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 1985, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please
- * see the file <mit-cpyright.h>.
- *
- * This routine generates the P permutation code for the DES.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "des.h"
-#include "des_internal.h"
-#include "tables.h"
-#include "des_prototypes.h"
-
-void
-gen(FILE * stream)
-{
-    /* P permutes 32 bit input R1 into 32 bit output R2 */
-
-    /* clear the output */
-    fprintf(stream, "    L2 = 0;\n");
-#ifndef        BIG
-    fprintf(stream, "    R2 = 0;\n");
-    fprintf(stream, "/* P operations */\n/* from right to right */\n");
-    /* first list mapping from left to left */
-    for (i = 0; i <= 31; i++)
-       if (P[i] < 32)
-           fprintf(stream, "    if (R1 & (1<<%d)) R2 |= 1<<%d;\n", P[i], i);
-#else /* BIG */
-    /* flip p into p_temp */
-    fprintf(stream, "    P_temp = R1;\n");
-    fprintf(stream, "    P_temp_p = (unsigned char *) &P_temp;\n");
-
-#ifdef AFS_DARWIN80_ENV
-    fprintf(stream, "#if defined(__i386__) || defined(__amd64__) || defined(__arm__)\n");
-    fprintf(stream, "    R2 = P_prime[0][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[1][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[2][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[3][*P_temp_p];\n");
-    fprintf(stream, "#elif defined(__ppc__) || defined(__ppc64__)\n");
-    fprintf(stream, "    R2 = P_prime[3][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[2][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[1][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[0][*P_temp_p];\n");
-    fprintf(stream, "#else\n#error Unsupported architecture\n#endif\n");
-#else /* !AFS_DARWIN80_ENV */
-#ifdef LSBFIRST
-    fprintf(stream, "    R2 = P_prime[0][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[1][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[2][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[3][*P_temp_p];\n");
-#else /* MSBFIRST */
-    fprintf(stream, "    R2 = P_prime[3][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[2][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[1][*P_temp_p++];\n");
-    fprintf(stream, "    R2 |= P_prime[0][*P_temp_p];\n");
-#endif /* MSBFIRST */
-#endif /* !AFS_DARWIN80_ENV */
-#endif /* BIG */
-}
diff --git a/src/des/make_p_table.c b/src/des/make_p_table.c
deleted file mode 100644 (file)
index 9e57092..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 1985, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please
- * see the file <mit-cpyright.h>.
- *
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#define WANT_P_TABLE
-#include "tables.h"
-
-static unsigned char P_temp[32];
-static afs_uint32 P_prime[4][256];
-
-void
-gen(FILE * stream)
-{
-    int i, j, k, m;
-    /* P permutes 32 bit input R1 into 32 bit output R2 */
-
-#ifdef BIG
-    /* flip p into p_temp */
-    for (i = 0; i < 32; i++)
-       P_temp[(int)P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i);
-
-    /*
-     * now for each byte of input, figure out all possible combinations
-     */
-    for (i = 0; i < 4; i++) {  /* each input byte */
-       for (j = 0; j < 256; j++) {     /* each possible byte value */
-           /* flip bit order */
-           k = j;
-           /* swap_byte_bits(j); */
-           for (m = 0; m < 8; m++) {   /* each bit */
-               if (k & (1 << m)) {
-                   /* set output values */
-                   P_prime[i][j] |= 1 << P_temp[(i * 8) + m];
-               }
-           }
-       }
-    }
-
-    fprintf(stream, "\n\tstatic afs_uint32 const P_prime[4][256] = {\n\t");
-    for (i = 0; i < 4; i++) {
-       fprintf(stream, "\n{ ");
-       for (j = 0; j < 64; j++) {
-           fprintf(stream, "\n");
-           for (k = 0; k < 4; k++) {
-               fprintf(stream, "0x%08lX",
-                       (unsigned long)P_prime[i][j * 4 + k]);
-               if ((j == 63) && (k == 3))
-                   fprintf(stream, "}");
-               if ((i == 3) && (j == 63) && (k == 3))
-                   fprintf(stream, "\n};");
-               else
-                   fprintf(stream, ", ");
-           }
-       }
-    }
-
-#endif
-    fprintf(stream, "\n");
-}
diff --git a/src/des/make_s.c b/src/des/make_s.c
deleted file mode 100644 (file)
index 00aa31f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 1985, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please
- * see the file <mit-cpyright.h>.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "des_internal.h"
-#include "s_table.h"
-
-void
-gen(stream)
-     FILE *stream;
-{
-    /* clear the output */
-    fprintf(stream, "\n\tL2 = 0; R2 = 0;");
-
-#ifdef notdef
-    /* P permutes 32 bit input R1 into 32 bit output R2 */
-
-    fprintf(stream, "\n/* P operations */\n/* first left to left */\n");
-    /* first list mapping from left to left */
-    for (i = 0; i <= 31; i++)
-       if (S[i] < 32)
-           fprintf(stream, "\n\tif (R1 & (1<<%d)) R2 |= 1<<%d;", S[i], i);
-#endif
-    fprintf(stream, "\n");
-}
diff --git a/src/des/make_s_table.c b/src/des/make_s_table.c
deleted file mode 100644 (file)
index e06d5ea..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 1985, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please
- * see the file <mit-cpyright.h>.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include <stdio.h>
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#define WANT_S_TABLE
-#include "tables.h"
-
-char temp[8][64];
-int des_debug;
-
-void
-gen(FILE * stream)
-{
-    afs_uint32 i, j, k, l, m, n;
-
-    /* rearrange the S table entries, and adjust for host bit order */
-
-    fprintf(stream, "static unsigned char const S_adj[8][64] = {");
-    fprintf(stream, "    /* adjusted */\n");
-
-    for (i = 0; i <= 7; i++) {
-       for (j = 0; j <= 63; j++) {
-           /*
-            * figure out which one to put in the new S[i][j]
-            *
-            * start by assuming the value of the input bits is "j" in
-            * host order, then figure out what it means in standard
-            * form.
-            */
-           k = swap_six_bits_to_ansi(j);
-           /* figure out the index for k */
-           l = (((k >> 5) & 01) << 5)
-               + ((k & 01) << 4) + ((k >> 1) & 0xf);
-           m = S[i][l];
-           /* restore in host order */
-           n = swap_four_bits_to_ansi(m);
-           if (des_debug)
-               fprintf(stderr,
-                       "i = %ld, j = %ld, k = %ld, l = %ld, m = %ld, n = %ld\n",
-                       (long)i, (long)j, (long)k, (long)l, (long)m, (long)n);
-           temp[i][j] = n;
-       }
-    }
-
-    for (i = 0; i <= 7; i++) {
-       fprintf(stream, "\n{ ");
-       k = 0;
-       for (j = 0; j <= 3; j++) {
-           fprintf(stream, "\n");
-           for (m = 0; m <= 15; m++) {
-               fprintf(stream, "%2d", temp[i][k]);
-               if (k == 63) {
-                   fprintf(stream, "\n}");
-               }
-               if ((k++ != 63) || (i != 7)) {
-                   fprintf(stream, ", ");
-               }
-           }
-       }
-    }
-
-    fprintf(stream, "\n};\n");
-}
diff --git a/src/des/misc.c b/src/des/misc.c
deleted file mode 100644 (file)
index 2ceffe7..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information,
- * please seethe file <mit-cpyright.h>.
- *
- * This file contains most of the routines needed by the various
- * make_foo programs, to account for bit- and byte-ordering on
- * different machine types.  It also contains other routines useful in
- * generating the intermediate source files.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-int des_debug;
-
-/*
- * The DES algorithm is defined in terms of MSBFIRST, so sometimes,
- * e.g.  VAXes, we need to fix it up.  ANSI order means the DES
- * MSBFIRST order.
- */
-
-#if 0                          /* These don't seem to get used anywhere.... */
-void
-swap_bits(char *array)
-{
-#ifdef MSBFIRST
-    /* just return */
-    return;
-#else /* LSBFIRST */
-    int old, new, i, j;
-
-    /* for an eight byte block-- */
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    for (i = 0; i <= 7; i++) {
-       old = *array;
-       new = 0;
-       for (j = 0; j <= 7; j++) {
-           new |= old & 01;    /* copy a bit */
-           if (j < 7) {
-               /* rotate in opposite directions */
-               old = old >> 1;
-               new = new << 1;
-           }
-       }
-       *array++ = new;
-    }
-#endif /* MSBFIRST */
-}
-
-afs_uint32
-long_swap_bits(afs_uint32 x)
-{
-#ifdef MSBFIRST
-    return x;
-#else
-    char *array = (char *)&x;
-    int old, new, i, j;
-
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    for (i = 0; i <= (sizeof(afs_int32) - 1); i++) {
-       old = *array;
-       new = 0;
-       for (j = 0; j <= 7; j++) {
-           if (old & 01)
-               new = new | 01;
-           if (j < 7) {
-               old = old >> 1;
-               new = new << 1;
-           }
-       }
-       *array++ = new;
-    }
-    return x;
-#endif /* LSBFIRST */
-}
-#endif /* 0 */
-
-afs_uint32
-swap_six_bits_to_ansi(afs_uint32 old)
-{
-    afs_uint32 new, j;
-
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    new = 0;
-    for (j = 0; j <= 5; j++) {
-       new |= old & 01;        /* copy a bit */
-       if (j < 5) {
-           /* rotate in opposite directions */
-           old = old >> 1;
-           new = new << 1;
-       }
-    }
-    return new;
-}
-
-afs_uint32
-swap_four_bits_to_ansi(afs_uint32 old)
-{
-    afs_uint32 new, j;
-
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    new = 0;
-    for (j = 0; j <= 3; j++) {
-       new |= (old & 01);      /* copy a bit */
-       if (j < 3) {
-           old = old >> 1;
-           new = new << 1;
-       }
-    }
-    return new;
-}
-
-afs_uint32
-swap_bit_pos_1(afs_uint32 x)
-{
-    /*
-     * This corrects for the bit ordering of the algorithm, e.g.
-     * bit 0 ==> msb, bit 7 lsb.
-     *
-     * given the number of a bit position, >=1, flips the bit order
-     * each byte. e.g. bit 3 --> bit 6, bit 13 --> bit 12
-     */
-    int y, z;
-
-    /* always do it, only used by des_make_key_perm.c so far */
-    y = (x - 1) / 8;
-    z = (x - 1) % 8;
-
-    x = (8 - z) + (y * 8);
-
-    return x;
-}
-
-afs_uint32
-swap_bit_pos_0(afs_uint32 x)
-{
-    /*  zero based version */
-
-    /*
-     * This corrects for the bit ordering of the algorithm, e.g.
-     * bit 0 ==> msb, bit 7 lsb.
-     */
-
-#ifdef MSBFIRST
-    return x;
-#else /* LSBFIRST */
-    int y, z;
-
-    /*
-     * given the number of a bit position, >=0, flips the bit order
-     * each byte. e.g. bit 3 --> bit 6, bit 13 --> bit 12
-     */
-    y = x / 8;
-    z = x % 8;
-
-    x = (7 - z) + (y * 8);
-
-    return x;
-#endif /* LSBFIRST */
-}
-
-afs_uint32
-swap_bit_pos_0_to_ansi(afs_uint32 x)
-{
-    /* zero based version */
-
-    /*
-     * This corrects for the bit ordering of the algorithm, e.g.
-     * bit 0 ==> msb, bit 7 lsb.
-     */
-
-    int y, z;
-    /*
-     * given the number of a bit position, >=0, flips the bit order each
-     * byte. e.g. bit 3 --> bit 6, bit 13 --> bit 12
-     */
-    y = x / 8;
-    z = x % 8;
-
-    x = (7 - z) + (y * 8);
-
-    return x;
-}
-
-afs_uint32
-rev_swap_bit_pos_0(afs_uint32 x)
-{
-    /* zero based version */
-
-    /*
-     * This corrects for the bit ordering of the algorithm, e.g.
-     *  bit 0 ==> msb, bit 7 lsb.
-     *
-     * Role of LSB and MSB flipped from the swap_bit_pos_0()
-     */
-
-#ifdef LSBFIRST
-    return x;
-#else /* MSBFIRST */
-
-    int y, z;
-
-    /*
-     * given the number of a bit position, >=0, flips the bit order each
-     * byte. e.g. bit 3 --> bit 6, bit 13 --> bit 12
-     */
-    y = x / 8;
-    z = x % 8;
-
-    x = (7 - z) + (y * 8);
-
-    return x;
-#endif /* MSBFIRST */
-}
-
-afs_uint32
-swap_byte_bits(afs_uint32 x)
-{
-#ifdef MSBFIRST
-    return x;
-#else /* LSBFIRST */
-
-    char *array = (char *)&x;
-    afs_uint32 old, new, j;
-
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    old = *array;
-    new = 0;
-    for (j = 0; j <= 7; j++) {
-       new |= (old & 01);      /* copy a bit */
-       if (j < 7) {
-           old = old >> 1;
-           new = new << 1;
-       }
-    }
-    return new;
-#endif /* LSBFIRST */
-}
-
-int
-swap_long_bytes_bit_number(afs_uint32 x)
-{
-    /*
-     * given a bit number (0-31) from a vax, swap the byte part of the
-     * bit number to change the byte ordering to mSBFIRST type
-     */
-#ifdef LSBFIRST
-    return x;
-#else /* MSBFIRST */
-    afs_uint32 y, z;
-
-    y = x / 8;                 /* initial byte component */
-    z = x % 8;                 /* bit within byte */
-
-    x = (3 - y) * 8 + z;
-    return x;
-#endif /* MSBFIRST */
-}
-
-#if !defined(KERNEL) && defined(AFS_DARWIN80_ENV)
-char *_darwin_whichstr[] = {
-    "#if defined(__ppc__) || defined(__ppc64__)\n",
-    "#elif defined(__i386__) || defined(__amd64__) || defined(__arm__)\n",
-    "#else\n#error architecture unsupported\n#endif\n"
-};
-int _darwin_which = 1;
-
-int
-_darwin_swap_long_bytes_bit_number(afs_uint32 x)
-{
-    /*
-     * given a bit number (0-31) from a vax, swap the byte part of the
-     * bit number to change the byte ordering to mSBFIRST type
-     */
-
-    afs_uint32 y, z;
-
-    if (!_darwin_which)
-       return x;
-
-    y = x / 8;                 /* initial byte component */
-    z = x % 8;                 /* bit within byte */
-
-    x = (3 - y) * 8 + z;
-    return x;
-}
-#endif /* !KERNEL && AFS_DARWIN80_ENV */
-
-void
-test_set(FILE * stream, const char *src, int testbit, const char *dest,
-        int setbit)
-{
-#ifdef DES_SHIFT_SHIFT
-    if (testbit == setbit)
-       fprintf(stream, "    %s |=  %s & (1<<%2d);\n", dest, src, testbit);
-    else
-       fprintf(stream, "    %s |= (%s & (1<<%2d)) %s %2d;\n", dest, src,
-               testbit, (testbit < setbit) ? "<<" : ">>",
-               abs(testbit - setbit));
-#else
-    fprintf(stream, "    if (%s & (1<<%2d))  %s |= 1<<%2d;\n", src, testbit,
-           dest, setbit);
-#endif
-}
diff --git a/src/des/mit-cpyright.h b/src/des/mit-cpyright.h
deleted file mode 100644 (file)
index cffdfc8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* All rights reserved. */
diff --git a/src/des/new_rnd_key.c b/src/des/new_rnd_key.c
deleted file mode 100644 (file)
index d91a255..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * New pseudo-random key generator, using DES encryption to make the
- * pseudo-random cycle as hard to break as DES.
- *
- * Written by Mark Lillibridge, MIT Project Athena
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- */
-
-#include "mit-cpyright.h"
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#ifdef AFS_PTHREAD_ENV
-#include <pthread.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-static afs_int32 des_set_sequence_number(des_cblock new_sequence_number);
-static afs_int32 des_generate_random_block(des_cblock block);
-
-#define XPRT_NEW_RND_KEY
-
-static int is_inited = 0;
-#ifdef AFS_PTHREAD_ENV
-/*
- * This mutex protects the following global variables:
- * is_inited
- */
-
-#include <assert.h>
-pthread_mutex_t des_init_mutex
-#ifdef PTHREAD_MUTEX_INITIALIZER
-= PTHREAD_MUTEX_INITIALIZER
-#endif
-;
-#define LOCK_INIT assert(pthread_mutex_lock(&des_init_mutex)==0)
-#define UNLOCK_INIT assert(pthread_mutex_unlock(&des_init_mutex)==0)
-#else
-#define LOCK_INIT
-#define UNLOCK_INIT
-#endif
-/*
- * des_random_key: create a random des key
- *
- * You should call des_set_random_number_generater_seed at least
- * once before this routine is called.  If you haven't, I'll try
- * to add a little randomness to the start point anyway.  Yes,
- * it recurses.  Deal with it.
- *
- * Notes: the returned key has correct parity and is guarenteed not
- *        to be a weak des key.  Des_generate_random_block is used to
- *        provide the random bits.
- */
-int
-des_random_key(des_cblock key)
-{
-    LOCK_INIT;
-    if (!is_inited) {
-       des_init_random_number_generator(key);
-    }
-    UNLOCK_INIT;
-    do {
-       des_generate_random_block(key);
-       des_fixup_key_parity(key);
-    } while (des_is_weak_key(key));
-
-    return (0);
-}
-
-/*
- * des_init_random_number_generator:
- *
- *    This routine takes a secret key possibly shared by a number
- * of servers and uses it to generate a random number stream that is
- * not shared by any of the other servers.  It does this by using the current
- * process id, host id, and the current time to the nearest second.  The
- * resulting stream seed is not useful information for cracking the secret
- * key.   Moreover, this routine keeps no copy of the secret key.
- * This routine is used for example, by the kerberos server(s) with the
- * key in question being the kerberos master key.
- *
- * Note: this routine calls des_set_random_generator_seed.
- */
-#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
-you lose ... (aka, you get to implement an analog of this for your system ...)
-#else
-
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <process.h>
-#include <afs/afsutil.h>
-#else
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-
-void
-des_init_random_number_generator(des_cblock key)
-{
-    struct {                   /* This must be 64 bits exactly */
-       afs_int32 process_id;
-       afs_int32 host_id;
-    } seed;
-    struct timeval time;       /* this must also be 64 bits exactly */
-    des_cblock new_key;
-
-    is_inited = 1;
-    /*
-     * use a host id and process id in generating the seed to ensure
-     * that different servers have different streams:
-     */
-#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV)
-    seed.host_id = gethostid();
-#endif
-    seed.process_id = getpid();
-
-    /*
-     * Generate a tempory value that depends on the key, host_id, and
-     * process_id such that it gives no useful information about the key:
-     */
-    des_set_random_generator_seed(key);
-    des_set_sequence_number((unsigned char *)&seed);
-    des_random_key(new_key);
-
-    /*
-     * use it to select a random stream:
-     */
-    des_set_random_generator_seed(new_key);
-
-    /*
-     * use a time stamp to ensure that a server started later does not reuse
-     * an old stream:
-     */
-    gettimeofday(&time, NULL);
-    des_set_sequence_number((unsigned char *)&time);
-
-    /*
-     * use the time stamp finally to select the final seed using the
-     * current random number stream:
-     */
-    des_random_key(new_key);
-    des_set_random_generator_seed(new_key);
-}
-
-#endif /* ifdef BSDUNIX */
-
-/*
- * This module implements a random number generator faculty such that the next
- * number in any random number stream is very hard to predict without knowing
- * the seed for that stream even given the preceeding random numbers.
- */
-
-/*
- * The secret des key schedule for the current stream of random numbers:
- */
-static union {
-    afs_int32 align;
-    des_key_schedule d;
-} random_sequence_key;
-
-/*
- * The sequence # in the current stream of random numbers:
- */
-static unsigned char sequence_number[8];
-
-#ifdef AFS_PTHREAD_ENV
-/*
- * This mutex protects the following global variables:
- * random_sequence_key
- * sequence_number
- */
-
-#include <assert.h>
-pthread_mutex_t des_random_mutex
-#ifdef PTHREAD_MUTEX_INITIALIZER
-= PTHREAD_MUTEX_INITIALIZER
-#endif
-;
-#define LOCK_RANDOM assert(pthread_mutex_lock(&des_random_mutex)==0)
-#define UNLOCK_RANDOM assert(pthread_mutex_unlock(&des_random_mutex)==0)
-#else
-#define LOCK_RANDOM
-#define UNLOCK_RANDOM
-#endif
-
-/*
- * des_set_random_generator_seed: this routine is used to select a random
- *                                number stream.  The stream that results is
- *                                totally determined by the passed in key.
- *                                (I.e., calling this routine again with the
- *                                same key allows repeating a sequence of
- *                                random numbers)
- *
- * Requires: key is a valid des key.  I.e., has correct parity and is not a
- *           weak des key.
- */
-void
-des_set_random_generator_seed(des_cblock key)
-{
-    int i;
-
-    /* select the new stream: (note errors are not possible here...) */
-    LOCK_RANDOM;
-    des_key_sched(key, random_sequence_key.d);
-
-    /* "seek" to the start of the stream: */
-    for (i = 0; i < 8; i++)
-       sequence_number[i] = 0;
-    UNLOCK_RANDOM;
-}
-
-/*
- * des_set_sequence_number: this routine is used to set the sequence number
- *                          of the current random number stream.  This routine
- *                          may be used to "seek" within the current random
- *                          number stream.
- *
- * Note that des_set_random_generator_seed resets the sequence number to 0.
- */
-static afs_int32
-des_set_sequence_number(des_cblock new_sequence_number)
-{
-    LOCK_RANDOM;
-    memcpy((char *)sequence_number, (char *)new_sequence_number,
-          sizeof(sequence_number));
-    UNLOCK_RANDOM;
-    return 0;
-}
-
-/*
- * des_generate_random_block: routine to return the next random number
- *                            from the current random number stream.
- *                            The returned number is 64 bits long.
- *
- * Requires: des_set_random_generator_seed must have been called at least once
- *           before this routine is called.
- */
-static afs_int32
-des_generate_random_block(des_cblock block)
-{
-    int i;
-
-    /*
-     * Encrypt the sequence number to get the new random block:
-     */
-    LOCK_RANDOM;
-    des_ecb_encrypt(sequence_number, block, random_sequence_key.d, 1);
-
-    /*
-     * Increment the sequence number as an 8 byte unsigned number with wrap:
-     * (using LSB here)
-     */
-    for (i = 0; i < 8; i++) {
-       sequence_number[i] = (sequence_number[i] + 1) & 0xff;
-       if (sequence_number[i])
-           break;
-    }
-    UNLOCK_RANDOM;
-    return 0;
-}
diff --git a/src/des/pcbc_encrypt.c b/src/des/pcbc_encrypt.c
deleted file mode 100644 (file)
index 563dd7d..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it-- fewer inner loops.
- * ( AUTH_DES_ITER defaults to 16, may be less)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext.  The cleartext and ciphertext should be in host order.
- *
- * These routines form the library interface to the des facilities.
- *
- * spm 8/85    MIT project athena
- */
-
-#include "mit-cpyright.h"
-#ifndef KERNEL
-#include <stdio.h>
-#include <string.h>
-#endif
-#include <afsconfig.h>
-#include <afs/param.h>
-#include "des.h"
-#include "des_prototypes.h"
-
-
-#include "des_internal.h"
-
-#define XPRT_PCBC_ENCRYPT
-
-/*
- * pcbc_encrypt is an "error propagation chaining" encrypt operation
- * for DES, similar to CBC, but that, on encryption, "xor"s the
- * plaintext of block N with the ciphertext resulting from block N,
- * then "xor"s that result with the plaintext of block N+1 prior to
- * encrypting block N+1. (decryption the appropriate inverse.  This
- * "pcbc" mode propagates a single bit error anywhere in either the
- * cleartext or ciphertext chain all the way through to the end. In
- * contrast, CBC mode limits a single bit error in the ciphertext to
- * affect only the current (8byte) block and the subsequent block.
- *
- * performs pcbc error-propagation chaining operation by xor-ing block
- * N+1 with both the plaintext (block N) and the ciphertext from block
- * N.  Either encrypts from cleartext to ciphertext, if encrypt != 0
- * or decrypts from ciphertext to cleartext, if encrypt == 0
- *
- * NOTE-- the output is ALWAYS an multiple of 8 bytes long.  If not
- * enough space was provided, your program will get trashed.
- *
- * For encryption, the cleartext string is null padded, at the end, to
- * an integral multiple of eight bytes.
- *
- * For decryption, the ciphertext will be used in integral multiples
- * of 8 bytes, but only the first "length" bytes returned into the
- * cleartext.
- *
- * This is NOT a standard mode of operation.
- *
- */
-/*
-    des_cblock *in;             * >= length bytes of input text *
-    des_cblock *out;            * >= length bytes of output text *
-    afs_int32 length;  * in bytes *
-    int encrypt;                * 0 ==> decrypt, else encrypt *
-    des_key_schedule key;       * precomputed key schedule *
-    des_cblock *iv;             * 8 bytes of ivec *
-*/
-afs_int32
-des_pcbc_encrypt(void * in, void * out, afs_int32 length,
-                des_key_schedule key, des_cblock * iv, int encrypt)
-{
-    afs_uint32 *input = (afs_uint32 *) in;
-    afs_uint32 *output = (afs_uint32 *) out;
-    afs_uint32 *ivec = (afs_uint32 *) iv;
-
-    afs_uint32 i, j;
-    afs_uint32 t_input[2];
-    afs_uint32 t_output[2];
-    unsigned char *t_in_p = (unsigned char *)t_input;
-    afs_uint32 xor_0, xor_1;
-
-    if (encrypt) {
-#ifdef MUSTALIGN
-       if (afs_pointer_to_int(ivec) & 3) {
-           memcpy((char *)&xor_0, (char *)ivec++, sizeof(xor_0));
-           memcpy((char *)&xor_1, (char *)ivec, sizeof(xor_1));
-       } else
-#endif
-       {
-           xor_0 = *ivec++;
-           xor_1 = *ivec;
-       }
-
-       for (i = 0; length > 0; i++, length -= 8) {
-           /* get input */
-#ifdef MUSTALIGN
-           if (afs_pointer_to_int(input) & 3) {
-               memcpy((char *)&t_input[0], (char *)input,
-                      sizeof(t_input[0]));
-               memcpy((char *)&t_input[1], (char *)(input + 1),
-                      sizeof(t_input[1]));
-           } else
-#endif
-           {
-               t_input[0] = *input;
-               t_input[1] = *(input + 1);
-           }
-
-           /* zero pad */
-           if (length < 8) {
-               for (j = length; j <= 7; j++)
-                   *(t_in_p + j) = 0;
-           }
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("clear", length, t_input[0], t_input[1]);
-#endif
-           /* do the xor for cbc into the temp */
-           t_input[0] ^= xor_0;
-           t_input[1] ^= xor_1;
-           /* encrypt */
-           (void)des_ecb_encrypt(t_input, t_output, key, encrypt);
-
-           /*
-            * We want to XOR with both the plaintext and ciphertext
-            * of the previous block, before we write the output, in
-            * case both input and output are the same space.
-            */
-#ifdef MUSTALIGN
-           if (afs_pointer_to_int(input) & 3) {
-               memcpy((char *)&xor_0, (char *)input++, sizeof(xor_0));
-               xor_0 ^= t_output[0];
-               memcpy((char *)&xor_1, (char *)input++, sizeof(xor_1));
-               xor_1 ^= t_output[1];
-           } else
-#endif
-           {
-               xor_0 = *input++ ^ t_output[0];
-               xor_1 = *input++ ^ t_output[1];
-           }
-
-
-           /* copy temp output and save it for cbc */
-#ifdef MUSTALIGN
-           if (afs_pointer_to_int(output) & 3) {
-               memcpy((char *)output++, (char *)&t_output[0],
-                      sizeof(t_output[0]));
-               memcpy((char *)output++, (char *)&t_output[1],
-                      sizeof(t_output[1]));
-           } else
-#endif
-           {
-               *output++ = t_output[0];
-               *output++ = t_output[1];
-           }
-
-#ifdef DEBUG
-           if (des_debug) {
-               des_debug_print("xor'ed", i, t_input[0], t_input[1]);
-               des_debug_print("cipher", i, t_output[0], t_output[1]);
-           }
-#endif
-       }
-       t_output[0] = 0;
-       t_output[1] = 0;
-       xor_0 = 0;
-       xor_1 = 0;
-       return 0;
-    }
-
-    else {
-       /* decrypt */
-#ifdef MUSTALIGN
-       if (afs_pointer_to_int(ivec) & 3) {
-           memcpy((char *)&xor_0, (char *)ivec++, sizeof(xor_0));
-           memcpy((char *)&xor_1, (char *)ivec, sizeof(xor_1));
-       } else
-#endif
-       {
-           xor_0 = *ivec++;
-           xor_1 = *ivec;
-       }
-
-       for (i = 0; length > 0; i++, length -= 8) {
-           /* get input */
-#ifdef MUSTALIGN
-           if (afs_pointer_to_int(input) & 3) {
-               memcpy((char *)&t_input[0], (char *)input++,
-                      sizeof(t_input[0]));
-               memcpy((char *)&t_input[1], (char *)input++,
-                      sizeof(t_input[1]));
-           } else
-#endif
-           {
-               t_input[0] = *input++;
-               t_input[1] = *input++;
-           }
-
-           /* no padding for decrypt */
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("cipher", i, t_input[0], t_input[1]);
-#else
-#ifdef lint
-           i = i;
-#endif
-#endif
-           /* encrypt */
-           (void)des_ecb_encrypt(t_input, t_output, key, encrypt);
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("out pre xor", i, t_output[0], t_output[1]);
-#endif
-           /* do the xor for cbc into the output */
-           t_output[0] ^= xor_0;
-           t_output[1] ^= xor_1;
-           /* copy temp output */
-#ifdef MUSTALIGN
-           if (afs_pointer_to_int(output) & 3) {
-               memcpy((char *)output++, (char *)&t_output[0],
-                      sizeof(t_output[0]));
-               memcpy((char *)output++, (char *)&t_output[1],
-                      sizeof(t_output[1]));
-           } else
-#endif
-           {
-               *output++ = t_output[0];
-               *output++ = t_output[1];
-           }
-
-           /* save xor value for next round */
-           xor_0 = t_output[0] ^ t_input[0];
-           xor_1 = t_output[1] ^ t_input[1];
-
-#ifdef DEBUG
-           if (des_debug)
-               des_debug_print("clear", i, t_output[0], t_output[1]);
-#endif
-       }
-       return 0;
-    }
-}
diff --git a/src/des/quad_cksum.c b/src/des/quad_cksum.c
deleted file mode 100644 (file)
index 8f6fe1c..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * Quadratic Congruential Manipulation Dectection Code
- *
- * ref: "Message Authentication"
- *             R.R. Jueneman, S. M. Matyas, C.H. Meyer
- *             IEEE Communications Magazine,
- *             Sept 1985 Vol 23 No 9 p 29-40
- *
- * This routine, part of the Athena DES library built for the Kerberos
- * authentication system, calculates a manipulation detection code for
- * a message.  It is a much faster alternative to the DES-checksum
- * method. No guarantees are offered for its security. Refer to the
- * paper noted above for more information
- *
- * Implementation for 4.2bsd
- * by S.P. Miller      Project Athena/MIT
- */
-
-/*
- * Algorithm (per paper):
- *             define:
- *             message to be composed of n m-bit blocks X1,...,Xn
- *             optional secret seed S in block X1
- *             MDC in block Xn+1
- *             prime modulus N
- *             accumulator Z
- *             initial (secret) value of accumulator C
- *             N, C, and S are known at both ends
- *             C and , optionally, S, are hidden from the end users
- *             then
- *                     (read array references as subscripts over time)
- *                     Z[0] = c;
- *                     for i = 1...n
- *                             Z[i] = (Z[i+1] + X[i])**2 modulo N
- *                     X[n+1] = Z[n] = MDC
- *
- *             Then pick
- *                     N = 2**31 -1
- *                     m = 16
- *                     iterate 4 times over plaintext, also use Zn
- *                     from iteration j as seed for iteration j+1,
- *                     total MDC is then a 128 bit array of the four
- *                     Zn;
- *
- *                     return the last Zn and optionally, all
- *                     four as output args.
- *
- * Modifications:
- *     To inhibit brute force searches of the seed space, this
- *     implementation is modified to have
- *     Z       = 64 bit accumulator
- *     C       = 64 bit C seed
- *     N       = 2**63 - 1
- *  S  = S seed is not implemented here
- *     arithmetic is not quite real double integer precision, since we
- *     cant get at the carry or high order results from multiply,
- *     but nontheless is 64 bit arithmetic.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-#include <afs/stds.h>
-
-
-#include "mit-cpyright.h"
-
-/* System include files */
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-#include <errno.h>
-
-/* Application include files */
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-/* Definitions for byte swapping */
-
-#ifdef LSBFIRST
-#define vaxtohl(x) (*((afs_uint32 *)(x)))
-#define vaxtohs(x) (*((unsigned short *)(x)))
-#else
-#define vaxtohl(x) four_bytes_vax_to_nets((char *)(x))
-#define vaxtohs(x) two_bytes_vax_to_nets((char *)(x))
-#endif
-
-/*** Routines ***************************************************** */
-
-#ifdef MSBFIRST
-
-static unsigned short
-two_bytes_vax_to_nets(char *p)
-{
-    union {
-       char pieces[2];
-       unsigned short result;
-    } short_conv;
-
-    short_conv.pieces[0] = p[1];
-    short_conv.pieces[1] = p[0];
-    return (short_conv.result);
-}
-
-static afs_uint32
-four_bytes_vax_to_nets(char *p)
-{
-    union {
-       char pieces[4];
-       afs_uint32 result;
-    } long_conv;
-
-    long_conv.pieces[0] = p[3];
-    long_conv.pieces[1] = p[2];
-    long_conv.pieces[2] = p[1];
-    long_conv.pieces[3] = p[0];
-    return (long_conv.result);
-}
-
-#endif
-
-/*
-    des_cblock *c_seed;                * secret seed, 8 bytes *
-    unsigned char *in;         * input block *
-    afs_uint32 *out;           * optional longer output *
-    int out_count;             * number of iterations *
-    afs_int32 length;          * original length in bytes *
-*/
-
-afs_uint32
-des_quad_cksum(unsigned char *in, afs_uint32 * out, afs_int32 length,
-              int out_count, des_cblock * c_seed)
-{
-
-    /*
-     * this routine both returns the low order of the final (last in
-     * time) 32bits of the checksum, and if "out" is not a null
-     * pointer, a longer version, up to entire 32 bytes of the
-     * checksum is written unto the address pointed to.
-     */
-
-    afs_uint32 z;
-    afs_uint32 z2;
-    afs_uint32 x;
-    afs_uint32 x2;
-    unsigned char *p;
-    afs_int32 len;
-    int i;
-
-    /* use all 8 bytes of seed */
-
-    z = vaxtohl(c_seed);
-    z2 = vaxtohl((char *)c_seed + 4);
-    if (out == NULL)
-       out_count = 1;          /* default */
-
-    /* This is repeated n times!! */
-    for (i = 1; i <= 4 && i <= out_count; i++) {
-       len = length;
-       p = in;
-       while (len) {
-           if (len > 1) {
-               x = (z + vaxtohs(p));
-               p += 2;
-               len -= 2;
-           } else {
-               x = (z + *(char *)p++);
-               len = 0;
-           }
-           x2 = z2;
-           z = ((x * x) + (x2 * x2)) % 0x7fffffff;
-           z2 = (x * (x2 + 83653421)) % 0x7fffffff;    /* modulo */
-           if (des_debug & 8)
-               printf("%ld %ld\n", afs_printable_int32_ld(z),
-                      afs_printable_int32_ld(z2));
-       }
-
-       if (out != NULL) {
-           *out++ = z;
-           *out++ = z2;
-       }
-    }
-    /* return final z value as 32 bit version of checksum */
-    return z;
-}
diff --git a/src/des/read_pssword.c b/src/des/read_pssword.c
deleted file mode 100644 (file)
index 670a2d8..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- *
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * This routine prints the supplied string to standard
- * output as a prompt, and reads a password string without
- * echoing.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#include "des.h"
-#include "conf.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-#ifdef BSDUNIX
-#ifdef AFS_SUN5_ENV
-#define BSD_COMP
-#endif
-#include <sys/ioctl.h>
-#include <signal.h>
-#include <setjmp.h>
-#endif
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef AFS_HPUX_ENV
-#include <bsdtty.h>
-#include <sys/ttold.h>
-#include <termios.h>
-static int intrupt;
-#endif
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-static int intrupt;
-#if defined(AFS_SGI_ENV) || defined (AFS_AIX_ENV) || defined(AFS_XBSD_ENV)     /*|| defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) */
-#undef BSDUNIX
-#endif
-
-#ifdef BSDUNIX
-static jmp_buf env;
-#endif
-
-#ifdef BSDUNIX
-#define POSIX
-#ifdef POSIX
-typedef void sigtype;
-#else
-typedef int sigtype;
-#endif
-static sigtype sig_restore();
-static push_signals(), pop_signals();
-#endif
-
-#include "des_prototypes.h"
-
-/*** Routines ****************************************************** */
-int
-des_read_password(des_cblock * k, char *prompt, int verify)
-{
-    int ok;
-    char key_string[BUFSIZ];
-
-#ifdef BSDUNIX
-    if (setjmp(env)) {
-       ok = -1;
-       goto lose;
-    }
-#endif
-
-    ok = des_read_pw_string(key_string, BUFSIZ, prompt, verify);
-    if (ok == 0)
-       des_string_to_key(key_string, k);
-
-#ifdef BSDUNIX
-  lose:
-#endif
-    memset(key_string, 0, sizeof(key_string));
-    return ok;
-}
-
-#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-static void catch(int);
-#endif
-
-#if    !defined(BSDUNIX) && (defined(AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV))
-#include <termio.h>
-#endif
-
-/*
- * This version just returns the string, doesn't map to key.
- *
- * Returns 0 on success, non-zero on failure.
- */
-int
-des_read_pw_string(char *s, int maxa, char *prompt, int verify)
-{
-    int ok = 0, cnt1 = 0;
-    char *ptr;
-#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-    int fno;
-    struct sigaction newsig, oldsig;
-    struct termios save_ttyb, ttyb;
-#endif
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-    FILE *fi;
-#endif
-#if    defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
-    struct termios ttyb;
-    struct sigaction osa, sa;
-#endif
-#ifdef BSDUNIX
-    jmp_buf old_env;
-    unsigned long flags;
-    struct sgttyb tty_state, echo_off_tty_state;
-    FILE *fi;
-#else
-#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
-    struct termio ttyb;
-    FILE *fi;
-    char savel, flags;
-    void (*sig) (int);
-#endif
-#endif
-#ifdef AFS_NT40_ENV
-    HANDLE hConStdin;
-    DWORD oldConMode, newConMode;
-    BOOL resetConMode = FALSE;
-#endif
-    char key_string[BUFSIZ];
-
-    if (maxa > BUFSIZ) {
-       return -1;
-    }
-#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-    if ((fi = fopen("/dev/tty", "r")) == NULL)
-       return -1;
-    setbuf(fi, (char *)NULL);  /* We don't want any buffering for our i/o. */
-    /*
-     * Install signal handler for SIGINT so that we can restore
-     * the tty settings after we change them.  The handler merely
-     * increments the variable "intrupt" to tell us that an
-     * interrupt signal was received.
-     */
-    newsig.sa_handler = catch;
-    sigemptyset(&newsig.sa_mask);
-    newsig.sa_flags = 0;
-    sigaction(SIGINT, &newsig, &oldsig);
-    intrupt = 0;
-
-    /*
-     * Get the terminal characters (save for later restoration) and
-     * reset them so that echo is off
-     */
-    fno = fileno(fi);
-    tcgetattr(fno, &ttyb);
-    save_ttyb = ttyb;
-    ttyb.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
-    tcsetattr(fno, TCSAFLUSH, &ttyb);
-#else
-#if    defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
-    if ((fi = fopen("/dev/tty", "r")) == NULL) {
-       return (-1);
-    } else
-       setbuf(fi, (char *)NULL);
-    sa.sa_handler = catch;
-    sa.sa_mask = 0;
-    sa.sa_flags = SA_INTERRUPT;
-    (void)sigaction(SIGINT, &sa, &osa);
-    intrupt = 0;
-    (void)ioctl(fileno(fi), TCGETS, &ttyb);
-    flags = ttyb.c_lflag;
-    ttyb.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
-    (void)ioctl(fileno(fi), TCSETSF, &ttyb);
-#else
-#ifdef BSDUNIX
-    /* XXX assume jmp_buf is typedef'ed to an array */
-    memcpy((char *)env, (char *)old_env, sizeof(env));
-    if (setjmp(env))
-       goto lose;
-    /* save terminal state */
-    if (ioctl(0, TIOCGETP, (char *)&tty_state) == -1)
-       return -1;
-    push_signals();
-    /* Turn off echo */
-    memcpy(&echo_off_tty_state, &tty_state, sizeof(tty_state));
-    echo_off_tty_state.sg_flags &= ~ECHO;
-    if (ioctl(0, TIOCSETP, (char *)&echo_off_tty_state) == -1)
-       return -1;
-#else
-#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
-    if ((fi = fopen("/dev/tty", "r+")) == NULL)
-       return (-1);
-    else
-       setbuf(fi, (char *)NULL);
-    sig = signal(SIGINT, catch);
-    intrupt = 0;
-    (void)ioctl(fileno(fi), TCGETA, &ttyb);
-    savel = ttyb.c_line;
-    ttyb.c_line = 0;
-    flags = ttyb.c_lflag;
-    ttyb.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
-    (void)ioctl(fileno(fi), TCSETAF, &ttyb);
-#else
-#ifdef AFS_NT40_ENV
-    /* turn off console input echoing */
-    if ((hConStdin = GetStdHandle(STD_INPUT_HANDLE)) != INVALID_HANDLE_VALUE) {
-       if (GetConsoleMode(hConStdin, &oldConMode)) {
-           newConMode = (oldConMode & ~(ENABLE_ECHO_INPUT));
-           if (SetConsoleMode(hConStdin, newConMode)) {
-               resetConMode = TRUE;
-           }
-       }
-    }
-#endif
-#endif
-#endif
-#endif
-#endif
-    while (!ok) {
-       (void)printf("%s", prompt);
-       (void)fflush(stdout);
-#ifdef CROSSMSDOS
-       h19line(s, sizeof(s), 0);
-       if (!strlen(s))
-           continue;
-#else
-       if (!fgets(s, maxa, stdin)) {
-           clearerr(stdin);
-           printf("\n");
-           if (cnt1++ > 1) {
-               /*
-                * Otherwise hitting ctrl-d will always leave us inside this loop forever!
-                */
-               break;
-           }
-           continue;
-       }
-       if ((ptr = strchr(s, '\n')))
-           *ptr = '\0';
-#endif
-       if (verify) {
-           printf("\nVerifying, please re-enter %s", prompt);
-           (void)fflush(stdout);
-#ifdef CROSSMSDOS
-           h19line(key_string, sizeof(key_string), 0);
-           if (!strlen(key_string))
-               continue;
-#else
-           if (!fgets(key_string, sizeof(key_string), stdin)) {
-               clearerr(stdin);
-               continue;
-           }
-           if ((ptr = strchr(key_string, '\n')))
-               *ptr = '\0';
-#endif
-           if (strcmp(s, key_string)) {
-               printf("\n\07\07Mismatch - try again\n");
-               (void)fflush(stdout);
-               continue;
-           }
-       }
-       ok = 1;
-    }
-
-#ifdef BSDUNIX
-  lose:
-#endif
-    if (!ok)
-       memset(s, 0, maxa);
-    printf("\n");
-#if defined(AFS_HPUX_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
-    /*
-     * Restore the terminal to its previous characteristics.
-     * Restore the old signal handler for SIGINT.
-     */
-    tcsetattr(fno, TCSANOW, &save_ttyb);
-    sigaction(SIGINT, &oldsig, NULL);
-    if (fi != stdin)
-       fclose(fi);
-
-    /*
-     * If we got a SIGINT while we were doing things, send the SIGINT
-     * to ourselves so that the calling program receives it (since we
-     * were intercepting it for a period of time.)
-     */
-    if (intrupt)
-       kill(getpid(), SIGINT);
-#else
-#if    defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
-    ttyb.c_lflag = flags;
-    (void)ioctl(fileno(fi), TCSETSW, &ttyb);
-    (void)sigaction(SIGINT, &osa, (struct sigaction *)NULL);
-    if (fi != stdin)
-       (void)fclose(fi);
-#else
-#ifdef BSDUNIX
-    if (ioctl(0, TIOCSETP, (char *)&tty_state))
-       ok = 0;
-    pop_signals();
-    memcpy((char *)old_env, (char *)env, sizeof(env));
-#else
-#if    defined (AFS_AIX_ENV) /*|| defined (AFS_HPUX_ENV)*/ || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
-    ttyb.c_lflag = flags;
-    ttyb.c_line = savel;
-    (void)ioctl(fileno(fi), TCSETAW, &ttyb);
-    (void)signal(SIGINT, sig);
-    if (fi != stdin)
-       (void)fclose(fi);
-    if (intrupt)
-       (void)kill(getpid(), SIGINT);
-#else
-#ifdef AFS_NT40_ENV
-    /* restore console to original mode settings */
-    if (resetConMode) {
-       (void)SetConsoleMode(hConStdin, oldConMode);
-    }
-#endif
-#endif
-#endif
-#endif
-#endif
-    if (verify)
-       memset(key_string, 0, sizeof(key_string));
-    s[maxa - 1] = 0;           /* force termination */
-    return !ok;                        /* return nonzero if not okay */
-}
-
-#ifdef BSDUNIX
-/*
- * this can be static since we should never have more than
- * one set saved....
- */
-#ifdef mips
-void static (*old_sigfunc[NSIG]) ();
-#else
-static sigtype(*old_sigfunc[NSIG]) ();
-#endif
-
-static
-push_signals()
-{
-    int i;
-    for (i = 0; i < NSIG; i++)
-       old_sigfunc[i] = signal(i, sig_restore);
-}
-
-static
-pop_signals()
-{
-    int i;
-    for (i = 0; i < NSIG; i++)
-       (void)signal(i, old_sigfunc[i]);
-}
-
-static sigtype
-sig_restore()
-{
-    longjmp(env, 1);
-}
-#endif
-
-
-#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-static void
-catch(int junk)
-{
-    ++intrupt;
-}
-#endif
diff --git a/src/des/s_table.h.ibm b/src/des/s_table.h.ibm
deleted file mode 100644 (file)
index 54ba04b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-
-/* des_s_tables.h
- * derived from des_make_s_tables.c
-       */
-static unsigned char S_adj[8][64] = /* adjusted */
-{
-
-14,  0,  4, 15, 13,  7,  1,  4,  2, 14, 15,  2, 11, 13,  8,  1, 
- 3, 10, 10,  6,  6, 12, 12, 11,  5,  9,  9,  5,  0,  3,  7,  8, 
- 4, 15,  1, 12, 14,  8,  8,  2, 13,  4,  6,  9,  2,  1, 11,  7, 
-15,  5, 12, 11,  9,  3,  7, 14,  3, 10, 10,  0,  5,  6,  0, 13, 
-
-15,  3,  1, 13,  8,  4, 14,  7,  6, 15, 11,  2,  3,  8,  4, 14, 
- 9, 12,  7,  0,  2,  1, 13, 10, 12,  6,  0,  9,  5, 11, 10,  5, 
- 0, 13, 14,  8,  7, 10, 11,  1, 10,  3,  4, 15, 13,  4,  1,  2, 
- 5, 11,  8,  6, 12,  7,  6, 12,  9,  0,  3,  5,  2, 14, 15,  9, 
-
-10, 13,  0,  7,  9,  0, 14,  9,  6,  3,  3,  4, 15,  6,  5, 10, 
- 1,  2, 13,  8, 12,  5,  7, 14, 11, 12,  4, 11,  2, 15,  8,  1, 
-13,  1,  6, 10,  4, 13,  9,  0,  8,  6, 15,  9,  3,  8,  0,  7, 
-11,  4,  1, 15,  2, 14, 12,  3,  5, 11, 10,  5, 14,  2,  7, 12, 
-
- 7, 13, 13,  8, 14, 11,  3,  5,  0,  6,  6, 15,  9,  0, 10,  3, 
- 1,  4,  2,  7,  8,  2,  5, 12, 11,  1, 12, 10,  4, 14, 15,  9, 
-10,  3,  6, 15,  9,  0,  0,  6, 12, 10, 11,  1,  7, 13, 13,  8, 
-15,  9,  1,  4,  3,  5, 14, 11,  5, 12,  2,  7,  8,  2,  4, 14, 
-
- 2, 14, 12, 11,  4,  2,  1, 12,  7,  4, 10,  7, 11, 13,  6,  1, 
- 8,  5,  5,  0,  3, 15, 15, 10, 13,  3,  0,  9, 14,  8,  9,  6, 
- 4, 11,  2,  8,  1, 12, 11,  7, 10,  1, 13, 14,  7,  2,  8, 13, 
-15,  6,  9, 15, 12,  0,  5,  9,  6, 10,  3,  4,  0,  5, 14,  3, 
-
-12, 10,  1, 15, 10,  4, 15,  2,  9,  7,  2, 12,  6,  9,  8,  5, 
- 0,  6, 13,  1,  3, 13,  4, 14, 14,  0,  7, 11,  5,  3, 11,  8, 
- 9,  4, 14,  3, 15,  2,  5, 12,  2,  9,  8,  5, 12, 15,  3, 10, 
- 7, 11,  0, 14,  4,  1, 10,  7,  1,  6, 13,  0, 11,  8,  6, 13, 
-
- 4, 13, 11,  0,  2, 11, 14,  7, 15,  4,  0,  9,  8,  1, 13, 10, 
- 3, 14, 12,  3,  9,  5,  7, 12,  5,  2, 10, 15,  6,  8,  1,  6, 
- 1,  6,  4, 11, 11, 13, 13,  8, 12,  1,  3,  4,  7, 10, 14,  7, 
-10,  9, 15,  5,  6,  0,  8, 15,  0, 14,  5,  2,  9,  3,  2, 12, 
-
-13,  1,  2, 15,  8, 13,  4,  8,  6, 10, 15,  3, 11,  7,  1,  4, 
-10, 12,  9,  5,  3,  6, 14, 11,  5,  0,  0, 14, 12,  9,  7,  2, 
- 7,  2, 11,  1,  4, 14,  1,  7,  9,  4, 12, 10, 14,  8,  2, 13, 
- 0, 15,  6, 12, 10,  9, 13,  0, 15,  3,  3,  5,  5,  6,  8, 11
-};
diff --git a/src/des/strng_to_key.c b/src/des/strng_to_key.c
deleted file mode 100644 (file)
index 6150749..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988, 1989 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it-- fewer inner loops.
- * (AUTH_DES_ITER defaults to 16, may be less.)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext.  The cleartext and ciphertext should be in host order.
- *
- * These routines form the library interface to the DES facilities.
- *
- *     spm     8/85    MIT project athena
- */
-
-#include "mit-cpyright.h"
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-/*
- * convert an arbitrary length string to a DES key
- */
-void
-des_string_to_key(char *str, des_cblock * key)
-{
-    char *in_str;
-    unsigned temp, i, j;
-    afs_int32 length;
-    unsigned char *k_p;
-    int forward;
-    char *p_char;
-    char k_char[64];
-    des_key_schedule key_sked;
-
-    in_str = str;
-    forward = 1;
-    p_char = k_char;
-    length = strlen(str);
-
-    /* init key array for bits */
-    memset(k_char, 0, sizeof(k_char));
-
-#ifdef DEBUG
-    if (des_debug)
-       fprintf(stdout,
-               "\n\ninput str length = %d  string = %s\nstring = 0x ",
-               length, str);
-#endif
-
-    /* get next 8 bytes, strip parity, xor */
-    for (i = 1; i <= length; i++) {
-       /* get next input key byte */
-       temp = (unsigned int)*str++;
-#ifdef DEBUG
-       if (des_debug)
-           fprintf(stdout, "%02x ", temp & 0xff);
-#endif
-       /* loop through bits within byte, ignore parity */
-       for (j = 0; j <= 6; j++) {
-           if (forward)
-               *p_char++ ^= (int)temp & 01;
-           else
-               *--p_char ^= (int)temp & 01;
-           temp = temp >> 1;
-       } while (--j > 0);
-
-       /* check and flip direction */
-       if ((i % 8) == 0)
-           forward = !forward;
-    }
-
-    /* now stuff into the key des_cblock, and force odd parity */
-    p_char = k_char;
-    k_p = (unsigned char *)key;
-
-    for (i = 0; i <= 7; i++) {
-       temp = 0;
-       for (j = 0; j <= 6; j++)
-           temp |= *p_char++ << (1 + j);
-       *k_p++ = (unsigned char)temp;
-    }
-
-    /* fix key parity */
-    des_fixup_key_parity(cblockptr_to_cblock(key));
-
-    /* Now one-way encrypt it with the folded key */
-    des_key_sched(cblockptr_to_cblock(key), key_sked);
-    des_cbc_cksum(charptr_to_cblockptr(in_str), key, length, key_sked, key);
-    /* erase key_sked */
-    memset(key_sked, 0, sizeof(key_sked));
-
-    /* now fix up key parity again */
-    des_fixup_key_parity(cblockptr_to_cblock(key));
-
-    if (des_debug)
-       fprintf(stdout, "\nResulting string_to_key = 0x%x 0x%x\n",
-               *((afs_uint32 *) key), *((afs_uint32 *) key + 1));
-}
diff --git a/src/des/tables.h b/src/des/tables.h
deleted file mode 100644 (file)
index 692a1b4..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * part of the Athena Kerberos encryption system
- *
- * spm 8/85
- */
-
-/*
- * Initial permutation, adjust to zero based subscript
- */
-#ifdef WANT_IP_TABLE
-static char IP[] = {
-    58 - 1, 50 - 1, 42 - 1, 34 - 1, 26 - 1, 18 - 1, 10 - 1, 2 - 1,
-    60 - 1, 52 - 1, 44 - 1, 36 - 1, 28 - 1, 20 - 1, 12 - 1, 4 - 1,
-    62 - 1, 54 - 1, 46 - 1, 38 - 1, 30 - 1, 22 - 1, 14 - 1, 6 - 1,
-    64 - 1, 56 - 1, 48 - 1, 40 - 1, 32 - 1, 24 - 1, 16 - 1, 8 - 1,
-    57 - 1, 49 - 1, 41 - 1, 33 - 1, 25 - 1, 17 - 1, 9 - 1, 1 - 1,
-    59 - 1, 51 - 1, 43 - 1, 35 - 1, 27 - 1, 19 - 1, 11 - 1, 3 - 1,
-    61 - 1, 53 - 1, 45 - 1, 37 - 1, 29 - 1, 21 - 1, 13 - 1, 5 - 1,
-    63 - 1, 55 - 1, 47 - 1, 39 - 1, 31 - 1, 23 - 1, 15 - 1, 7 - 1,
-};
-#endif
-
-/*
- * Final permutation,  FP = IP^(-1) adjust to zero based subscript
- */
-#ifdef WANT_FP_TABLE
-static char FP[] = {
-    40 - 1, 8 - 1, 48 - 1, 16 - 1, 56 - 1, 24 - 1, 64 - 1, 32 - 1,
-    39 - 1, 7 - 1, 47 - 1, 15 - 1, 55 - 1, 23 - 1, 63 - 1, 31 - 1,
-    38 - 1, 6 - 1, 46 - 1, 14 - 1, 54 - 1, 22 - 1, 62 - 1, 30 - 1,
-    37 - 1, 5 - 1, 45 - 1, 13 - 1, 53 - 1, 21 - 1, 61 - 1, 29 - 1,
-    36 - 1, 4 - 1, 44 - 1, 12 - 1, 52 - 1, 20 - 1, 60 - 1, 28 - 1,
-    35 - 1, 3 - 1, 43 - 1, 11 - 1, 51 - 1, 19 - 1, 59 - 1, 27 - 1,
-    34 - 1, 2 - 1, 42 - 1, 10 - 1, 50 - 1, 18 - 1, 58 - 1, 26 - 1,
-    33 - 1, 1 - 1, 41 - 1, 9 - 1, 49 - 1, 17 - 1, 57 - 1, 25 - 1,
-};
-#endif
-
-/* the E selection function, adjusted to zero based subscripts */
-#ifdef WANT_E_TABLE
-static char E[] = {
-    32 - 1, 1 - 1, 2 - 1, 3 - 1, 4 - 1, 5 - 1,
-    4 - 1, 5 - 1, 6 - 1, 7 - 1, 8 - 1, 9 - 1,
-    8 - 1, 9 - 1, 10 - 1, 11 - 1, 12 - 1, 13 - 1,
-    12 - 1, 13 - 1, 14 - 1, 15 - 1, 16 - 1, 17 - 1,
-    16 - 1, 17 - 1, 18 - 1, 19 - 1, 20 - 1, 21 - 1,
-    20 - 1, 21 - 1, 22 - 1, 23 - 1, 24 - 1, 25 - 1,
-    24 - 1, 25 - 1, 26 - 1, 27 - 1, 28 - 1, 29 - 1,
-    28 - 1, 29 - 1, 30 - 1, 31 - 1, 32 - 1, 1 - 1,
-};
-#endif
-
-/* the P permutation, adjusted to zero based subscripts */
-#ifdef WANT_P_TABLE
-static char P[] = {
-    16 - 1, 7 - 1, 20 - 1, 21 - 1,
-    29 - 1, 12 - 1, 28 - 1, 17 - 1,
-    1 - 1, 15 - 1, 23 - 1, 26 - 1,
-    5 - 1, 18 - 1, 31 - 1, 10 - 1,
-    2 - 1, 8 - 1, 24 - 1, 14 - 1,
-    32 - 1, 27 - 1, 3 - 1, 9 - 1,
-    19 - 1, 13 - 1, 30 - 1, 6 - 1,
-    22 - 1, 11 - 1, 4 - 1, 25 - 1,
-};
-#endif
-
-/* S tables, original form */
-#ifdef WANT_S_TABLE
-static char S[8][64] = {
-    {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
-     0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
-     4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
-     15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,},
-
-    {15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
-     3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
-     0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
-     13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,},
-
-    {10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
-     13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
-     13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
-     1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,},
-
-    {7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
-     13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
-     10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
-     3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,},
-
-    {2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
-     14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
-     4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
-     11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,},
-
-    {12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
-     10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
-     9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
-     4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,},
-
-    {4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
-     13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
-     1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
-     6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,},
-
-    {13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
-     1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
-     7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
-     2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}
-};
-#endif
diff --git a/src/des/test/Makefile.in b/src/des/test/Makefile.in
deleted file mode 100644 (file)
index c99bcc2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-srcdir=@srcdir@
-include @TOP_OBJDIR@/src/config/Makefile.config
-include @TOP_OBJDIR@/src/config/Makefile.lwp
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-
-#  Test programs
-PROGS = \
-       key_test \
-       testit \
-       verify
-
-LIBS=\
-       ${TOP_LIBDIR}/libdes.a \
-
-all test: $(PROGS)
-
-clean:
-       $(RM) -f *.o *.a testit verify key_test core
-
-install:
-
-testit: testit.o 
-       $(AFS_LDRULE) testit.o ${LIBS}
-verify: verify.o ../libdes.a
-       $(AFS_LDRULE) verify.o ${LIBS}
-key_test: key_test.o ../libdes.a
-       $(AFS_LDRULE) key_test.o ${LIBS}
-
diff --git a/src/des/test/NTMakefile b/src/des/test/NTMakefile
deleted file mode 100644 (file)
index 9c07e72..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2000, International Business Machines Corporation and others.
-# All Rights Reserved.
-#
-# This software has been released under the terms of the IBM Public
-# License.  For details, see the LICENSE file in the top-level source
-# directory or online at http://www.openafs.org/dl/license10.html
-
-RELDIR=des\test
-!include ..\..\config\NTMakefile.$(SYS_NAME)
-
-$(OUT)\testit.exe: $(OUT)\testit.obj $(DESTDIR)\lib\afsdes.lib $(DESTDIR)\lib\afs\afsutil.lib
-       $(EXECONLINK)
-
-$(OUT)\verify.exe: $(OUT)\verify.obj $(DESTDIR)\lib\afsdes.lib $(DESTDIR)\lib\afs\afsutil.lib
-       $(EXECONLINK)
-
-$(OUT)\key_test.exe: $(OUT)\key_test.obj $(DESTDIR)\lib\afsdes.lib $(DESTDIR)\lib\afs\afsutil.lib
-       $(EXECONLINK)
-
-$(OUT)\tests: $(OUT)\testit.exe $(OUT)\verify.exe $(OUT)\key_test.exe
-
-mkdir:
-       
diff --git a/src/des/test/key_test.c b/src/des/test/key_test.c
deleted file mode 100644 (file)
index 0ba5efb..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * exit status:                 0 ==> success
- *                     -1 ==> error
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include <mit-cpyright.h>
-#include <stdio.h>
-#include <errno.h>
-#include <des.h>
-
-#define MIN_ARGC       0       /* min # args, not incl flags */
-#define MAX_ARGC       99      /* max # args, not incl flags */
-
-extern char *errmsg();
-extern int des_key_sched();
-char *progname;
-int sflag;
-int vflag;
-int kflag;
-int mflag;
-int pid;
-extern int des_debug;
-
-afs_int32 dummy[2];
-unsigned char dum_c[8] = { 0x80, 1, 1, 1, 1, 1, 1, 1 };
-des_key_schedule KS;
-des_cblock kk;
-
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-    /*  Local Declarations */
-
-    int i;
-    progname = argv[0];                /* salt away invoking program */
-
-    while (--argc > 0 && (*++argv)[0] == '-')
-       for (i = 1; argv[0][i] != '\0'; i++) {
-           switch (argv[0][i]) {
-
-               /* debug flag */
-           case 'd':
-               des_debug = 1;
-               continue;
-
-               /* keys flag */
-           case 'k':
-               kflag = 1;
-               continue;
-
-               /* test ANSI msb only key */
-           case 'm':
-               mflag = 1;
-               continue;
-
-           default:
-               printf("%s: illegal flag \"%c\" ", progname, argv[0][i]);
-               exit(1);
-           }
-       };
-
-    if (argc < MIN_ARGC || argc > MAX_ARGC) {
-       printf("Usage: xxx [-xxx]  xxx xxx\n");
-       exit(1);
-    }
-
-    /*  argv[0] now points to first non-option arg, if any */
-
-
-    if (des_debug) {
-       if (mflag) {
-           fprintf(stderr, "\nChecking a key 0x 80 01 01 01 01 01 01 01 ");
-           fprintf(stderr, "\nKey = ");
-           des_key_sched(dum_c, KS);
-           des_cblock_print(dum_c);
-           return;
-       }
-
-       if (kflag) {
-           printf("\nCHecking a weak key...");
-           dummy[0] = 0x01fe01fe;
-           dummy[1] = 0x01fe01fe;
-           des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-
-           dummy[0] = 0x01010101;
-           dummy[1] = 0x01010101;
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-           des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKS= %x", *(afs_int32 *) KS);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKS= %X", *(afs_int32 *) KS);
-#endif
-           dummy[0] = 0x01010101;
-           dummy[1] = 0x01010101;
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-           des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKS= %x", *(afs_int32 *) KS);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKS= %X", *(afs_int32 *) KS);
-#endif
-
-           dummy[0] = 0x80808080;
-           dummy[1] = 0x80808080;
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-           des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKS[0]= %x", *(afs_int32 *) KS);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKS[0]= %X", *(afs_int32 *) KS);
-#endif
-
-           printf("\nstring to key 'a'");
-           des_string_to_key("a", dummy);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-           des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKS= %x", *(afs_int32 *) KS);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKS= %X", *(afs_int32 *) KS);
-#endif
-
-           printf("\nstring to key 'c'");
-           des_string_to_key("c", dummy);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-           des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-           fprintf(stderr, "\nKS= %x", *(afs_int32 *) KS);
-#endif
-#ifdef CROSSMSDOS
-           fprintf(stderr, "\nKS= %X", *(afs_int32 *) KS);
-#endif
-       }
-
-       printf("\nstring to key 'e'");
-       des_string_to_key("e", dummy);
-#ifdef BSDUNIX
-       fprintf(stderr, "\nKey[0] = %x Key[1] = %x", dummy[0], dummy[1]);
-#endif
-#ifdef CROSSMSDOS
-       fprintf(stderr, "\nKey[0] = %X Key[1] = %X", dummy[0], dummy[1]);
-#endif
-       des_key_sched(dummy, KS);
-#ifdef BSDUNIX
-       fprintf(stderr, "\nKS= %x", KS[0]);
-#endif
-#ifdef CROSSMSDOS
-       fprintf(stderr, "\nKS= %X", KS[0]);
-#endif
-
-       printf("\ndes_string_to_key '%s'", argv[0]);
-       des_string_to_key(argv[0], dummy);
-#ifdef notdef
-       des_string_to_key(argv[0], dummy);
-
-       for (i = 0; i < 1; i++)
-           des_key_sched(dummy, KS);
-    } else {
-       for (i = 0; i < 1000; i++) {
-           des_string_to_key(argv[0], kk);
-           des_key_sched(kk, KS);
-       }
-#endif
-    }
-}
diff --git a/src/des/test/testit.c b/src/des/test/testit.c
deleted file mode 100644 (file)
index 3579cba..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * exit returns         0 ==> success
- *             -1 ==> error
- */
-
-#include <mit-cpyright.h>
-#include <stdio.h>
-#include <errno.h>
-#include <des.h>
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-
-#define MIN_ARGC       0       /* min # args, not incl flags */
-#define MAX_ARGC       2       /* max # args, not incl flags */
-
-/* MIN_ARGC == MAX_ARGC ==> required # args */
-
-extern char *errmsg();
-extern void des_string_to_key();
-extern int des_key_sched();
-extern int des_ecb_encrypt();
-extern int des_cbc_encrypt();
-extern int des_pcbc_encrypt();
-
-char *progname;
-int sflag;
-int vflag;
-int tflag;
-int nflag = 1000;
-int cflag;
-int des_debug;
-des_key_schedule KS;
-unsigned char cipher_text[64];
-unsigned char clear_text[64] = "Now is the time for all ";
-unsigned char clear_text2[64] = "7654321 Now is the time for ";
-unsigned char clear_text3[64] = { 2, 0, 0, 0, 1, 0, 0, 0 };
-unsigned char *input;
-
-/* 0x0123456789abcdef */
-des_cblock default_key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
-des_cblock s_key;
-des_cblock default_ivec = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef };
-unsigned char *ivec;
-des_cblock zero_key = { 1 };
-int i, j;
-
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-    /*  Local Declarations */
-
-    long in_length;
-
-    progname = argv[0];                /* salt away invoking program */
-
-    while (--argc > 0 && (*++argv)[0] == '-')
-       for (i = 1; argv[0][i] != '\0'; i++) {
-           switch (argv[0][i]) {
-
-               /* debug flag */
-           case 'd':
-               des_debug = 1;
-               continue;
-
-               /* verbose flag */
-           case 'v':
-               vflag = 1;
-               continue;
-
-               /* cbc flag */
-           case 'c':
-               cflag = 1;
-               continue;
-
-               /* string to key only flag */
-           case 's':
-               sflag = 1;
-               continue;
-
-               /* test flag - use known key and cleartext */
-           case 't':
-               tflag = 1;
-               continue;
-
-               /* iteration count */
-           case 'n':
-               sscanf(&argv[0][i + 1], "%d", &nflag);
-               argv[0][i + 1] = '\0';  /* force it to stop */
-               break;
-
-           default:
-               printf("%s: illegal flag \"%c\" ", progname, argv[0][i]);
-               exit(1);
-           }
-       };
-
-    if (argc < MIN_ARGC || argc > MAX_ARGC) {
-       printf("Usage: xxx [-xxx]  xxx xxx\n");
-       exit(1);
-    }
-
-    /* argv[0] now points to first non-option arg, if any */
-
-    if (tflag) {
-       /* use known input and key */
-       des_key_sched(default_key, KS);
-       input = clear_text;
-       ivec = (unsigned char *)default_ivec;
-    } else {
-       /*des_string_to_key(argv[0],s_key); */
-       des_string_to_key("test", s_key);
-       if (vflag) {
-           input = (unsigned char *)s_key;
-           fprintf(stdout, "\nstring = %s, key = ", argv[0]);
-           for (i = 0; i <= 7; i++)
-               fprintf(stdout, "%02x ", *input++);
-       }
-       des_string_to_key("test", s_key);
-       if (vflag) {
-           input = (unsigned char *)s_key;
-           fprintf(stdout, "\nstring = %s, key = ", argv[0]);
-           for (i = 0; i <= 7; i++)
-               fprintf(stdout, "%02x ", *input++);
-       }
-       des_key_sched(s_key, KS);
-       input = (unsigned char *)argv[1];
-       ivec = (unsigned char *)argv[2];
-    }
-
-
-    if (cflag) {
-       fprintf(stdout, "\nclear %s\n", input);
-       in_length = strlen(input);
-       des_cbc_encrypt(input, cipher_text, (long)in_length, KS, ivec, 1);
-       fprintf(stdout, "\n\nencrypted ciphertext = (low to high bytes)");
-       for (i = 0; i <= 7; i++) {
-           fprintf(stdout, "\n");
-           for (j = 0; j <= 7; j++)
-               fprintf(stdout, "%02x ", cipher_text[i * 8 + j]);
-       }
-       des_cbc_encrypt(cipher_text, clear_text, (long)in_length, KS, ivec,
-                       0);
-       fprintf(stdout, "\n\ndecrypted clear_text = %s", clear_text);
-
-       fprintf(stdout, "\nclear %s\n", input);
-       input = clear_text2;
-       des_cbc_cksum(input, cipher_text, (long)strlen(input), KS, ivec, 1);
-       fprintf(stdout, "\n\nencrypted cksum = (low to high bytes)\n");
-       for (j = 0; j <= 7; j++)
-           fprintf(stdout, "%02x ", cipher_text[j]);
-
-       /* test out random number generator */
-       for (i = 0; i <= 7; i++) {
-           des_random_key(cipher_text);
-           des_key_sched(cipher_text, KS);
-           fprintf(stdout, "\n\nrandom key = (low to high bytes)\n");
-           for (j = 0; j <= 7; j++)
-               fprintf(stdout, "%02x ", cipher_text[j]);
-       }
-    } else {
-       if (vflag)
-           fprintf(stdout, "\nclear %s\n", input);
-       do_encrypt(input, cipher_text);
-       do_decrypt(clear_text, cipher_text);
-    }
-}
-
-flip(array)
-     char *array;
-{
-    int old, new, i, j;
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    for (i = 0; i <= 7; i++) {
-       old = *array;
-       new = 0;
-       for (j = 0; j <= 7; j++) {
-           if (old & 01)
-               new = new | 01;
-           if (j < 7) {
-               old = old >> 1;
-               new = new << 1;
-           }
-       }
-       *array = new;
-       array++;
-    }
-}
-
-do_encrypt(in, out)
-     char *in;
-     char *out;
-{
-    for (i = 1; i <= nflag; i++) {
-       des_ecb_encrypt(in, out, KS, 1);
-       if (vflag) {
-           fprintf(stdout, "\nclear %s\n", in);
-           for (j = 0; j <= 7; j++)
-               fprintf(stdout, "%02 X ", in[j] & 0xff);
-           fprintf(stdout, "\tcipher ");
-           for (j = 0; j <= 7; j++)
-               fprintf(stdout, "%02X ", out[j] & 0xff);
-       }
-    }
-}
-
-do_decrypt(in, out)
-     char *out;
-     char *in;
-    /* try to invert it */
-{
-    for (i = 1; i <= nflag; i++) {
-       des_ecb_encrypt(out, in, KS, 0);
-       if (vflag) {
-           fprintf(stdout, "\nclear %s\n", in);
-           for (j = 0; j <= 7; j++)
-               fprintf(stdout, "%02X ", in[j] & 0xff);
-           fprintf(stdout, "\tcipher ");
-           for (j = 0; j <= 7; j++)
-               fprintf(stdout, "%02X ", out[j] & 0xff);
-       }
-    }
-}
diff --git a/src/des/test/verify.c b/src/des/test/verify.c
deleted file mode 100644 (file)
index 1212341..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * Program to test the correctness of the DES library
- * implementation.
- *
- * exit returns         0 ==> success
- *             -1 ==> error
- */
-
-#include <mit-cpyright.h>
-#include <stdio.h>
-#include <errno.h>
-#include <des.h>
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-
-extern char *errmsg();
-extern void des_string_to_key();
-extern int des_key_sched();
-extern int des_ecb_encrypt();
-extern int des_cbc_encrypt();
-
-char *progname;
-int nflag = 2;
-int vflag;
-int mflag;
-int zflag;
-int pid;
-int des_debug;
-des_key_schedule KS;
-unsigned char cipher_text[64];
-unsigned char clear_text[64] = "Now is the time for all ";
-unsigned char clear_text2[64] = "7654321 Now is the time for ";
-unsigned char clear_text3[64] = { 2, 0, 0, 0, 1, 0, 0, 0 };
-unsigned char output[64];
-unsigned char zero_text[8] = { 0x0, 0, 0, 0, 0, 0, 0, 0 };
-unsigned char msb_text[8] = { 0x0, 0, 0, 0, 0, 0, 0, 0x40 };   /* to ANSI MSB */
-unsigned char *input;
-
-/* 0x0123456789abcdef */
-unsigned char default_key[8] = {
-    0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef
-};
-unsigned char key2[8] = { 0x08, 0x19, 0x2a, 0x3b, 0x4c, 0x5d, 0x6e, 0x7f };
-unsigned char key3[8] = { 0x80, 1, 1, 1, 1, 1, 1, 1 };
-des_cblock s_key;
-unsigned char default_ivec[8] = {
-    0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef
-};
-unsigned char *ivec;
-unsigned char zero_key[8] = { 1, 1, 1, 1, 1, 1, 1, 1 };        /* just parity bits */
-int i, j;
-
-/*
- * Can also add :
- * plaintext = 0, key = 0, cipher = 0x8ca64de9c1b123a7 (or is it a 1?)
- */
-
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-    /* Local Declarations */
-    afs_int32 in_length;
-
-    progname = argv[0];                /* salt away invoking program */
-
-    while (--argc > 0 && (*++argv)[0] == '-')
-       for (i = 1; argv[0][i] != '\0'; i++) {
-           switch (argv[0][i]) {
-
-               /* debug flag */
-           case 'd':
-               des_debug = 3;
-               continue;
-
-           case 'z':
-               zflag = 1;
-               continue;
-
-           case 'm':
-               mflag = 1;
-               continue;
-
-           default:
-               printf("%s: illegal flag \"%c\" ", progname, argv[0][i]);
-               exit(1);
-           }
-       };
-
-    if (argc) {
-       fprintf(stderr, "Usage: %s [-dmz]\n", progname);
-       exit(1);
-    }
-
-    /* use known input and key */
-
-    /* ECB zero text zero key */
-    if (zflag) {
-       input = zero_text;
-       des_key_sched(zero_key, KS);
-       printf("plaintext = key = 0, cipher = 0x8ca64de9c1b123a7\n");
-       do_encrypt(input, cipher_text);
-       printf("\tcipher  = (low to high bytes)\n\t\t");
-       for (j = 0; j <= 7; j++)
-           printf("%02x ", cipher_text[j]);
-       printf("\n");
-       do_decrypt(output, cipher_text);
-       return;
-    }
-
-    if (mflag) {
-       input = msb_text;
-       des_key_sched(key3, KS);
-       printf("plaintext = 0x00 00 00 00 00 00 00 40, ");
-       printf("key = 0, cipher = 0x??\n");
-       do_encrypt(input, cipher_text);
-       printf("\tcipher  = (low to high bytes)\n\t\t");
-       for (j = 0; j <= 7; j++) {
-           printf("%02x ", cipher_text[j]);
-       }
-       printf("\n");
-       do_decrypt(output, cipher_text);
-       return;
-    }
-
-    /* ECB mode Davies and Price */
-    {
-       input = zero_text;
-       des_key_sched(key2, KS);
-       printf("Examples per FIPS publication 81, keys ivs and cipher\n");
-       printf("in hex.  These are the correct answers, see below for\n");
-       printf("the actual answers.\n\n");
-       printf("Examples per Davies and Price.\n\n");
-       printf("EXAMPLE ECB\tkey = 08192a3b4c5d6e7f\n");
-       printf("\tclear = 0\n");
-       printf("\tcipher = 25 dd ac 3e 96 17 64 67\n");
-       printf("ACTUAL ECB\n");
-       printf("\tclear \"%s\"\n", input);
-       do_encrypt(input, cipher_text);
-       printf("\tcipher  = (low to high bytes)\n\t\t");
-       for (j = 0; j <= 7; j++)
-           printf("%02x ", cipher_text[j]);
-       printf("\n\n");
-       do_decrypt(output, cipher_text);
-    }
-
-    /* ECB mode */
-    {
-       des_key_sched(default_key, KS);
-       input = clear_text;
-       ivec = default_ivec;
-       printf("EXAMPLE ECB\tkey = 0123456789abcdef\n");
-       printf("\tclear = \"Now is the time for all \"\n");
-       printf("\tcipher = 3f a4 0e 8a 98 4d 48 15 ...\n");
-       printf("ACTUAL ECB\n\tclear \"%s\"", input);
-       do_encrypt(input, cipher_text);
-       printf("\n\tcipher      = (low to high bytes)\n\t\t");
-       for (j = 0; j <= 7; j++) {
-           printf("%02x ", cipher_text[j]);
-       }
-       printf("\n\n");
-       do_decrypt(output, cipher_text);
-    }
-
-    /* CBC mode */
-    printf("EXAMPLE CBC\tkey = 0123456789abcdef");
-    printf("\tiv = 1234567890abcdef\n");
-    printf("\tclear = \"Now is the time for all \"\n");
-    printf("\tcipher =\te5 c7 cd de 87 2b f2 7c\n");
-    printf("\t\t\t43 e9 34 00 8c 38 9c 0f\n");
-    printf("\t\t\t68 37 88 49 9a 7c 05 f6\n");
-
-    printf("ACTUAL CBC\n\tclear \"%s\"\n", input);
-    in_length = strlen(input);
-    des_cbc_encrypt(input, cipher_text, (afs_int32) in_length, KS, ivec, 1);
-    printf("\tciphertext = (low to high bytes)\n");
-    for (i = 0; i <= 7; i++) {
-       printf("\t\t");
-       for (j = 0; j <= 7; j++) {
-           printf("%02x ", cipher_text[i * 8 + j]);
-       }
-       printf("\n");
-    }
-    des_cbc_encrypt(cipher_text, clear_text, (afs_int32) in_length, KS, ivec,
-                   0);
-    printf("\tdecrypted clear_text = \"%s\"\n", clear_text);
-
-    printf("EXAMPLE CBC checksum");
-    printf("\tkey =  0123456789abcdef\tiv =  1234567890abcdef\n");
-    printf("\tclear =\t\t\"7654321 Now is the time for \"\n");
-    printf("\tchecksum\t58 d2 e7 7e 86 06 27 33, ");
-    printf("or some part thereof\n");
-    input = clear_text2;
-    des_cbc_cksum(input, cipher_text, (afs_int32) strlen(input), KS, ivec, 1);
-    printf("ACTUAL CBC checksum\n");
-    printf("\t\tencrypted cksum = (low to high bytes)\n\t\t");
-    for (j = 0; j <= 7; j++)
-       printf("%02x ", cipher_text[j]);
-    printf("\n\n");
-}
-
-flip(array)
-     char *array;
-{
-    int old, new, i, j;
-    /* flips the bit order within each byte from 0 lsb to 0 msb */
-    for (i = 0; i <= 7; i++) {
-       old = *array;
-       new = 0;
-       for (j = 0; j <= 7; j++) {
-           if (old & 01)
-               new = new | 01;
-           if (j < 7) {
-               old = old >> 1;
-               new = new << 1;
-           }
-       }
-       *array = new;
-       array++;
-    }
-}
-
-do_encrypt(in, out)
-     char *in;
-     char *out;
-{
-    for (i = 1; i <= nflag; i++) {
-       des_ecb_encrypt(in, out, KS, 1);
-       if (des_debug) {
-           printf("\nclear %s\n", in);
-           for (j = 0; j <= 7; j++)
-               printf("%02 X ", in[j] & 0xff);
-           printf("\tcipher ");
-           for (j = 0; j <= 7; j++)
-               printf("%02X ", out[j] & 0xff);
-       }
-    }
-}
-
-do_decrypt(in, out)
-     char *out;
-     char *in;
-    /* try to invert it */
-{
-    for (i = 1; i <= nflag; i++) {
-       des_ecb_encrypt(out, in, KS, 0);
-       if (des_debug) {
-           printf("clear %s\n", in);
-           for (j = 0; j <= 7; j++)
-               printf("%02X ", in[j] & 0xff);
-           printf("\tcipher ");
-           for (j = 0; j <= 7; j++)
-               printf("%02X ", out[j] & 0xff);
-       }
-    }
-}
diff --git a/src/des/util.c b/src/des/util.c
deleted file mode 100644 (file)
index 7776325..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-cpyright.h>.
- *
- * Miscellaneous debug printing utilities
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include "mit-cpyright.h"
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-#include <sys/types.h>
-#include "des.h"
-#include "des_prototypes.h"
-
-int
-des_cblock_print_file(des_cblock * x, FILE * fp)
-{
-    unsigned char *y = (unsigned char *)x;
-    int i = 0;
-    fprintf(fp, " 0x { ");
-
-    while (i++ < 8) {
-       fprintf(fp, "%x", *y++);
-       if (i < 8)
-           fprintf(fp, ", ");
-    }
-    fprintf(fp, " }");
-
-    return (0);
-}
-
-#ifdef DEBUG
-int
-des_debug_print(char *area, int x, char *arg1, char *arg2)
-{
-    ;
-}
-#endif
diff --git a/src/des/weak_key.c b/src/des/weak_key.c
deleted file mode 100644 (file)
index c539679..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 1989 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * These routines form the library interface to the DES facilities.
- *
- * Originally written 8/85 by Steve Miller, MIT Project Athena.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifndef KERNEL
-#include <stdio.h>
-#endif
-
-#include "des.h"
-#include "des_internal.h"
-#include "des_prototypes.h"
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-/*
- * The following are the weak DES keys:
- */
-static const des_cblock weak[16] = {
-    /* weak keys */
-    {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
-    {0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe},
-    {0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e},
-    {0xe0, 0xe0, 0xe0, 0xe0, 0xf1, 0xf1, 0xf1, 0xf1},
-
-    /* semi-weak */
-    {0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe},
-    {0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01},
-
-    {0x1f, 0xe0, 0x1f, 0xe0, 0x0e, 0xf1, 0x0e, 0xf1},
-    {0xe0, 0x1f, 0xe0, 0x1f, 0xf1, 0x0e, 0xf1, 0x0e},
-
-    {0x01, 0xe0, 0x01, 0xe0, 0x01, 0xf1, 0x01, 0xf1},
-    {0xe0, 0x01, 0xe0, 0x01, 0xf1, 0x01, 0xf1, 0x01},
-
-    {0x1f, 0xfe, 0x1f, 0xfe, 0x0e, 0xfe, 0x0e, 0xfe},
-    {0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x0e, 0xfe, 0x0e},
-
-    {0x01, 0x1f, 0x01, 0x1f, 0x01, 0x0e, 0x01, 0x0e},
-    {0x1f, 0x01, 0x1f, 0x01, 0x0e, 0x01, 0x0e, 0x01},
-
-    {0xe0, 0xfe, 0xe0, 0xfe, 0xf1, 0xfe, 0xf1, 0xfe},
-    {0xfe, 0xe0, 0xfe, 0xe0, 0xfe, 0xf1, 0xfe, 0xf1}
-};
-
-/*
- * des_is_weak_key: returns true iff key is a [semi-]weak des key.
- *
- * Requires: key has correct odd parity.
- */
-int
-des_is_weak_key(des_cblock key)
-{
-    int i;
-    const des_cblock *weak_p = weak;
-
-    for (i = 0; i < (sizeof(weak) / sizeof(des_cblock)); i++) {
-       if (!memcmp((char *)weak_p++, (char *)key, sizeof(des_cblock)))
-           return 1;
-    }
-
-    return 0;
-}
index a013ddc97e0c1546d7c38dab3318aa8d6843d180..a9d09b31d6b9ef6f77b1ab35fd8b344a91263b2d 100644 (file)
@@ -214,7 +214,7 @@ state_analyzer.o: ${TVICED}/state_analyzer.c
 
 dafileserver: ${objects} ${LIBS}
        $(AFS_LDRULE) ${objects} \
-               ${LIBS} $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 state_analyzer: ${SDBGOBJS}
        $(AFS_LDRULE) ${SDBGOBJS} \
index 7d63001df3d63d1f728983c3b269dfb9ff01ee02..bb068ed01d3936d35e8035d8a311bc2c65f80e68 100644 (file)
@@ -205,7 +205,8 @@ namei_ops.o: ${VOL}/namei_ops.c
        $(AFS_CCRULE) $(VOL)/namei_ops.c
 
 davolserver: ${objects} ${LIBS}
-       $(AFS_LDRULE) ${objects} ${LIBS} $(LIB_roken) ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) ${objects} ${LIBS} $(LIB_hcrypto) $(LIB_roken) \
+               ${MT_LIBS} ${XLIBS}
 
 install: davolserver
        ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
index c90bd61369beae5ed199ab846daa0d01e56874a2..b6fc9f2b92dd797534f97304c924ecb1c55107d1 100644 (file)
@@ -43,7 +43,6 @@ LIBS=${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/util.a \
        ${TOP_LIBDIR}/libkauth.a \
        ${TOP_LIBDIR}/libprot.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${XLIBS}
 
 all: translate_et
index e99d64fa511b4bbde9d77ac75d303139e2321a9b..7520167848e02376b1f27176076ba23cac339817 100644 (file)
@@ -22,13 +22,14 @@ LIBS=${TOP_LIBDIR}/libvolser.a ${TOP_LIBDIR}/vlib.a ${TOP_LIBDIR}/libacl.a \
         ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libvldb.a \
         ${TOP_LIBDIR}/libubik.a \
         ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libsys.a \
-        ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a \
+        ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/librxkad.a \
         ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libkauth.a \
        ${TOP_LIBDIR}/libaudit.a \
        ${TOP_LIBDIR}/libafsint.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
        ${TOP_LIBDIR}/libsys.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/util.a
 
 all: ${TOP_INCDIR}/afs/fsprobe.h ${TOP_LIBDIR}/libfsprobe.a fsprobe_test
index 2c2e92d0545737801e9a98a87484e566a4c2ab65..e220c7055514a1329304f6fc4bdb7df7ad33d322 100644 (file)
@@ -40,7 +40,6 @@ LIBS=\
        ${TOP_LIBDIR}/libkauth.a \
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/util.a
 
index 21d11f5135d98de13cf0fedbe610315beb34afe9..59b2b8464cdf74839afe6c8e97af249308854ca6 100644 (file)
@@ -32,11 +32,11 @@ LIBS=${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libsys.a  \
        ${TOP_LIBDIR}/liblwp.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/libafsutil.a \
-       $(DBM)
+       $(DBM) \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 UKSRCS=authclient.c user.c kautils.h kaserver.h kaaux.c katoken.c \
        kalocalcell.c client.c kaerrors.c
@@ -49,10 +49,10 @@ KLIBS=${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libsys.a  \
        ${TOP_LIBDIR}/liblwp.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libcom_err.a \
-       ${TOP_LIBDIR}/libafsutil.a
+       ${TOP_LIBDIR}/libafsutil.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 OBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o katoken.o kautils.o kalocalcell.o kaerrors.o user.o krb_tf.o
 KOBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o katoken.o kautils.o kalocalcell.o kaerrors.o user.krb.o krb_tf.o
@@ -94,7 +94,8 @@ kaserver: kautils.o kalocalcell.o kadatabase.o kaprocs.o kalog.o kauth.ss.o kaut
        $(AFS_LDRULE) kaserver.o kautils.o kalocalcell.o kadatabase.o \
                krb_udp.o kaprocs.o kalog.o kauth.ss.o kauth.xdr.o kaaux.o \
                kaauxdb.o \
-               $(LIBS) $(LIB_roken) ${XLIBS} ${TOP_LIBDIR}/libaudit.a
+               $(LIBS) $(LIB_roken) $(LIB_crypt) ${XLIBS} \
+               ${TOP_LIBDIR}/libaudit.a
 
 kaserver.o: kaserver.c ${INCLS} AFS_component_version_number.o
 
@@ -159,8 +160,6 @@ libkauth.krb.a: $(KOBJS) AFS_component_version_number.o
        $(AR) crv $@ $(KOBJS) AFS_component_version_number.o
        $(RANLIB) $@
 
-read_passwd.o: read_passwd.c
-
 katoken.o: katoken.c ${INCLS}
 
 client.o: client.c ${INCLS} AFS_component_version_number.o
@@ -176,22 +175,22 @@ krb_tf.o: krb_tf.c ${INCLS}
 
 kas: kauth.h kautils.h admin_tools.o libkauth.a $(LIBS) kas.o kkids.o
        $(AFS_LDRULE) kas.o admin_tools.o kkids.o libkauth.a \
-               ${LIBS} $(LIB_roken) ${XLIBS}
+               ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 klog: AFS_component_version_number.o kauth.h kautils.h libkauth.a $(LIBS) \
        klog.o
        $(AFS_LDRULE) klog.o libkauth.a \
-               ${LIBS} $(LIB_roken) ${XLIBS}
+               ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 klog.o: klog.c kauth.h kautils.h AFS_component_version_number.o
 
 klog.krb: kauth.h kautils.h libkauth.krb.a $(KLIBS) klog.o
        $(AFS_LDRULE) klog.o libkauth.krb.a \
-               ${KLIBS} $(LIB_roken) ${XLIBS}
+               ${KLIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 knfs: kauth.h kautils.h libkauth.a $(LIBS) knfs.o
        $(AFS_LDRULE) knfs.o libkauth.a \
-               ${LIBS} $(LIB_roken) ${XLIBS}
+               ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 knfs.o: knfs.c AFS_component_version_number.o
 
@@ -200,17 +199,17 @@ klogin.o: klogin.c ${INCLS} AFS_component_version_number.o
 
 klogin: libkauth.a $(LIBS) klogin.o
        $(AFS_LDRULE) klogin.o libkauth.a \
-               ${LIBS} $(LIB_roken) ${XLIBS}
+               ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 klogin.krb: libkauth.a $(KLIBS) klogin.o
        $(AFS_LDRULE) klogin.o libkauth.krb.a \
-               ${KLIBS} $(LIB_roken) ${XLIBS}
+               ${KLIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 kpasswd.o: kauth.h kautils.h ${INCLS} kpasswd.c AFS_component_version_number.o
 
 kpasswd: kauth.h kautils.h libkauth.a $(LIBS) kpasswd.o kkids.o
        $(AFS_LDRULE) kpasswd.o kkids.o libkauth.a \
-               ${LIBS} $(LIB_roken) ${XLIBS}
+               ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
 
 kpwvalid.o: kpwvalid.c AFS_component_version_number.o
 
index f70998da1cc1583c9f0174537e43f62318af47f4..7a6c556cee0f558b02203a33a3be32f50a6c0e06 100644 (file)
@@ -33,6 +33,7 @@ KAUTH_LIBOBJS =\
        $(OUT)\kauth.cs.obj \
        $(OUT)\kaaux.obj \
        $(OUT)\client.obj \
+       $(OUT)\crypt.obj \
        $(OUT)\authclient.obj \
        $(OUT)\katoken.obj \
        $(OUT)\kautils.obj \
@@ -86,13 +87,13 @@ AFSLIBS =  \
        $(AFSLIBDIR)\afsaudit.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\afslwp.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrxstat.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
        
 TOKENLIB = $(DESTDIR)\lib\afs\afspioctl.lib
index 29b0ac27a64c36a3fa8de4a1fa3d32d397f3d67c..7e953f68ec7528c237f877a331f8282564608464 100644 (file)
@@ -39,9 +39,8 @@
 #include <afs/cmd.h>
 #include <afs/com_err.h>
 #include <afs/afsutil.h>
-#include <des.h>
-#include <des_prototypes.h>
-
+#include <hcrypto/des.h>
+#include <hcrypto/ui.h>
 #include "kauth.h"
 #include "kauth_internal.h"
 #include "kautils.h"
@@ -766,7 +765,7 @@ StringToKey(struct cmd_syndesc *as, void *arock)
     ka_PrintBytes((char *)&key, sizeof(key));
     printf("'.\n");
 
-    des_string_to_key(as->parms[0].items->data, ktc_to_cblockptr(&key));
+    DES_string_to_key(as->parms[0].items->data, ktc_to_cblockptr(&key));
 
     printf("Converting %s with the DES string to key yields key='",
           as->parms[0].items->data);
@@ -1412,7 +1411,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
                    sprintf(msg, "Administrator's (%s) Password: ", name);
                else
                    sprintf(msg, "Password for %s: ", name);
-               code = read_pw_string(passwd, sizeof(passwd), msg, 0);
+               code = UI_UTIL_read_pw_string(passwd, sizeof(passwd), msg, 0);
                if (code)
                    code = KAREADPW;
                else if (strlen(passwd) == 0)
@@ -1427,7 +1426,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
                ka_GetAdminToken(name, instance, cell, &key, KA_SIXHOURS,
                                 &token, 0 /* !new */ );
            if (code == KABADREQUEST) {
-               des_string_to_key(passwd, ktc_to_cblockptr(&key));
+               DES_string_to_key(passwd, ktc_to_cblockptr(&key));
                code =
                    ka_GetAdminToken(name, instance, cell, &key, KA_SIXHOURS,
                                     &token, 0 /* !new */ );
@@ -1518,7 +1517,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
 
                    strcpy(msg, p + 1);
                    strcat(msg, ": ");
-                   code = read_pw_string(password, sizeof(password), msg, 1);
+                   code = UI_UTIL_read_pw_string(password, sizeof(password), msg, 1);
                    if (code)
                        code = KAREADPW;
                    else if (strlen(password) == 0)
index e4c067759521d2f0c80bea6a51520df972420c69..22a96309a206e070dfe6e320371c9ec5baec8ddf 100644 (file)
 #endif
 #include <string.h>
 #include <stdio.h>
-#include <des.h>
-#include <des_prototypes.h>
 #include <rx/rxkad.h>
 #include <afs/cellconfig.h>
 #include <ubik.h>
 #include <afs/auth.h>
 #include <afs/afsutil.h>
+#include <hcrypto/des.h>
+
 #include "kauth.h"
 #include "kautils.h"
 
@@ -58,7 +58,7 @@ static int debug = 0;
 #ifdef ENCRYPTIONBLOCKSIZE
 #undef ENCRYPTIONBLOCKSIZE
 #endif
-#define ENCRYPTIONBLOCKSIZE (sizeof(des_cblock))
+#define ENCRYPTIONBLOCKSIZE (sizeof(DES_cblock))
 
 /* Copy the specified list of servers into a specially know cell named
    "explicit".  The cell can then be used to debug experimental servers. */
@@ -503,7 +503,7 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con
                struct ktc_token * token, afs_int32 * pwexpires)
 {                              /* days until it expires */
     afs_int32 code;
-    des_key_schedule schedule;
+    DES_key_schedule schedule;
     Date request_time;
     struct ka_gettgtRequest request;
     struct ka_gettgtAnswer answer_old;
@@ -515,7 +515,7 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con
     int version;
 
     LOCK_GLOBAL_MUTEX;
-    if ((code = des_key_sched(ktc_to_cblock(key), schedule))) {
+    if ((code = DES_key_sched(ktc_to_cblock(key), &schedule))) {
        UNLOCK_GLOBAL_MUTEX;
        return KABADKEY;
     }
@@ -536,8 +536,8 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con
     memcpy(request.label, req_label, sizeof(request.label));
     arequest.SeqLen = sizeof(request);
     arequest.SeqBody = (char *)&request;
-    des_pcbc_encrypt(arequest.SeqBody, arequest.SeqBody, arequest.SeqLen,
-                    schedule, ktc_to_cblockptr(key), ENCRYPT);
+    DES_pcbc_encrypt(arequest.SeqBody, arequest.SeqBody, arequest.SeqLen,
+                    &schedule, ktc_to_cblockptr(key), ENCRYPT);
 
     oanswer.MaxSeqLen = sizeof(answer);
     oanswer.SeqLen = 0;
@@ -572,8 +572,8 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con
            return code;
        return KAUBIKCALL;
     }
-    des_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
-                    schedule, ktc_to_cblockptr(key), DECRYPT);
+    DES_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
+                    &schedule, ktc_to_cblockptr(key), DECRYPT);
 
     switch (version) {
     case 1:
@@ -641,7 +641,7 @@ ka_GetToken(char *name, char *instance, char *cell, char *cname, char *cinst, st
     ka_BBS oanswer;
     char *strings;
     int len;
-    des_key_schedule schedule;
+    DES_key_schedule schedule;
     int version;
     afs_int32 pwexpires;
 
@@ -649,7 +649,7 @@ ka_GetToken(char *name, char *instance, char *cell, char *cname, char *cinst, st
     aticket.SeqLen = auth_token->ticketLen;
     aticket.SeqBody = auth_token->ticket;
 
-    code = des_key_sched(ktc_to_cblock(&auth_token->sessionKey), schedule);
+    code = DES_key_sched(ktc_to_cblock(&auth_token->sessionKey), &schedule);
     if (code) {
        UNLOCK_GLOBAL_MUTEX;
        return KABADKEY;
@@ -657,7 +657,8 @@ ka_GetToken(char *name, char *instance, char *cell, char *cname, char *cinst, st
 
     times.start = htonl(start);
     times.end = htonl(end);
-    des_ecb_encrypt(&times, &times, schedule, ENCRYPT);
+    DES_ecb_encrypt((DES_cblock *)&times, (DES_cblock *)&times, &schedule,
+                   ENCRYPT);
 
     atimes.SeqLen = sizeof(times);
     atimes.SeqBody = (char *)&times;
@@ -690,8 +691,9 @@ ka_GetToken(char *name, char *instance, char *cell, char *cname, char *cinst, st
        return KAUBIKCALL;
     }
 
-    des_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
-                    schedule, ktc_to_cblockptr(&auth_token->sessionKey), DECRYPT);
+    DES_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
+                    &schedule, ktc_to_cblockptr(&auth_token->sessionKey),
+                    DECRYPT);
 
     switch (version) {
     case 1:
index c0dd382e7f130b5d5b64aea9fbb4fcd1ab947fa8..9a989059358955a5544c5b562fd940ad69853ee5 100644 (file)
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <afs/afsutil.h>
-#include <des.h>
-#include <des_prototypes.h>
+#include <hcrypto/des.h>
+#include <hcrypto/ui.h>
+
 #include "kauth.h"
 #include "kautils.h"
 
-
 /* This defines the Andrew string_to_key function.  It accepts a password
    string as input and converts it via a one-way encryption algorithm to a DES
    encryption key.  It is compatible with the original Andrew authentication
@@ -79,16 +79,16 @@ Andrew_StringToKey(char *str, char *cell,   /* cell for password */
            keybytes[i] = (unsigned char)(temp << 1);
        }
     }
-    des_fixup_key_parity(ktc_to_cblock(key));
+    DES_set_odd_parity(ktc_to_cblock(key));
 }
 
 static void
 StringToKey(char *str, char *cell,     /* cell for password */
            struct ktc_encryptionKey *key)
 {
-    des_key_schedule schedule;
-    unsigned char temp_key[8];
-    char ivec[8];
+    DES_key_schedule schedule;
+    DES_cblock temp_key;
+    DES_cblock ivec;
     char password[BUFSIZ];
     int passlen;
 
@@ -98,18 +98,19 @@ StringToKey(char *str, char *cell,  /* cell for password */
     if ((passlen = strlen(password)) > sizeof(password))
        passlen = sizeof(password);
 
-    memcpy(ivec, "kerberos", 8);
-    memcpy(temp_key, "kerberos", 8);
-    des_fixup_key_parity(temp_key);
-    des_key_sched(temp_key, schedule);
-    des_cbc_cksum(charptr_to_cblockptr(password), charptr_to_cblockptr(ivec), passlen, schedule, charptr_to_cblockptr(ivec));
+    memcpy(&ivec, "kerberos", 8);
+    memcpy(&temp_key, "kerberos", 8);
+    DES_set_odd_parity(&temp_key);
+    DES_key_sched(&temp_key, &schedule);
+    DES_cbc_cksum((DES_cblock *) password, &ivec, passlen, &schedule, &ivec);
 
-    memcpy(temp_key, ivec, 8);
-    des_fixup_key_parity(temp_key);
-    des_key_sched(temp_key, schedule);
-    des_cbc_cksum(charptr_to_cblockptr(password), ktc_to_cblockptr(key), passlen, schedule, charptr_to_cblockptr(ivec));
+    memcpy(&temp_key, &ivec, 8);
+    DES_set_odd_parity(&temp_key);
+    DES_key_sched(&temp_key, &schedule);
+    DES_cbc_cksum((DES_cblock *)password, ktc_to_cblock(key), passlen,
+                  &schedule, &ivec);
 
-    des_fixup_key_parity(ktc_to_cblock(key));
+    DES_set_odd_parity(ktc_to_cblock(key));
 }
 
 void
@@ -150,7 +151,7 @@ ka_ReadPassword(char *prompt, int verify, char *cell,
 
     LOCK_GLOBAL_MUTEX;
     memset(key, 0, sizeof(struct ktc_encryptionKey));
-    code = read_pw_string(password, sizeof(password), prompt, verify);
+    code = UI_UTIL_read_pw_string(password, sizeof(password), prompt, verify);
     if (code) {
        UNLOCK_GLOBAL_MUTEX;
        return KAREADPW;
diff --git a/src/kauth/crypt.c b/src/kauth/crypt.c
new file mode 100644 (file)
index 0000000..dcee3be
--- /dev/null
@@ -0,0 +1,982 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Tom Truscott.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <afsconfig.h>
+#include <afs/param.h>
+
+/* This crypt() implementation is only used by the Andrew string_to_key
+ * function on Windows. All Unix platforms use their own crypt() 
+ * implementation
+ */
+
+#include <windows.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * UNIX password, and DES, encryption.
+ * By Tom Truscott, trt@rti.rti.org,
+ * from algorithms by Robert W. Baldwin and James Gillogly.
+ *
+ * References:
+ * "Mathematical Cryptology for Computer Scientists and Mathematicians,"
+ * by Wayne Patterson, 1987, ISBN 0-8476-7438-X.
+ *
+ * "Password Security: A Case History," R. Morris and Ken Thompson,
+ * Communications of the ACM, vol. 22, pp. 594-597, Nov. 1979.
+ *
+ * "DES will be Totally Insecure within Ten Years," M.E. Hellman,
+ * IEEE Spectrum, vol. 16, pp. 32-39, July 1979.
+ */
+
+/* =====  Configuration ==================== */
+
+/*
+ * define "MUST_ALIGN" if your compiler cannot load/store
+ * long integers at arbitrary (e.g. odd) memory locations.
+ * (Either that or never pass unaligned addresses to des_cipher!)
+ */
+#if !defined(vax)
+#define        MUST_ALIGN
+#endif
+
+#ifdef CHAR_BITS
+#if CHAR_BITS != 8
+#error C_block structure assumes 8 bit characters
+#endif
+#endif
+
+/*
+ * define "B64" to be the declaration for a 64 bit integer.
+ * XXX this feature is currently unused, see "endian" comment below.
+ */
+#if defined(cray)
+#define        B64     long
+#endif
+#if defined(convex)
+#define        B64     long long
+#endif
+
+/*
+ * define "LARGEDATA" to get faster permutations, by using about 72 kilobytes
+ * of lookup tables.  This speeds up des_setkey() and des_cipher(), but has
+ * little effect on crypt().
+ */
+#if defined(notdef)
+#define        LARGEDATA
+#endif
+
+/* compile with "-DSTATIC=int" when profiling */
+#ifndef STATIC
+#define        STATIC  static
+#endif
+#ifdef CRYPT_DEBUG
+STATIC prtab();
+#endif
+
+/* ==================================== */
+
+/*
+ * Cipher-block representation (Bob Baldwin):
+ *
+ * DES operates on groups of 64 bits, numbered 1..64 (sigh).  One
+ * representation is to store one bit per byte in an array of bytes.  Bit N of
+ * the NBS spec is stored as the LSB of the Nth byte (index N-1) in the array.
+ * Another representation stores the 64 bits in 8 bytes, with bits 1..8 in the
+ * first byte, 9..16 in the second, and so on.  The DES spec apparently has
+ * bit 1 in the MSB of the first byte, but that is particularly noxious so we
+ * bit-reverse each byte so that bit 1 is the LSB of the first byte, bit 8 is
+ * the MSB of the first byte.  Specifically, the 64-bit input data and key are
+ * converted to LSB format, and the output 64-bit block is converted back into
+ * MSB format.
+ *
+ * DES operates internally on groups of 32 bits which are expanded to 48 bits
+ * by permutation E and shrunk back to 32 bits by the S boxes.  To speed up
+ * the computation, the expansion is applied only once, the expanded
+ * representation is maintained during the encryption, and a compression
+ * permutation is applied only at the end.  To speed up the S-box lookups,
+ * the 48 bits are maintained as eight 6 bit groups, one per byte, which
+ * directly feed the eight S-boxes.  Within each byte, the 6 bits are the
+ * most significant ones.  The low two bits of each byte are zero.  (Thus,
+ * bit 1 of the 48 bit E expansion is stored as the "4"-valued bit of the
+ * first byte in the eight byte representation, bit 2 of the 48 bit value is
+ * the "8"-valued bit, and so on.)  In fact, a combined "SPE"-box lookup is
+ * used, in which the output is the 64 bit result of an S-box lookup which
+ * has been permuted by P and expanded by E, and is ready for use in the next
+ * iteration.  Two 32-bit wide tables, SPE[0] and SPE[1], are used for this
+ * lookup.  Since each byte in the 48 bit path is a multiple of four, indexed
+ * lookup of SPE[0] and SPE[1] is simple and fast.  The key schedule and
+ * "salt" are also converted to this 8*(6+2) format.  The SPE table size is
+ * 8*64*8 = 4K bytes.
+ *
+ * To speed up bit-parallel operations (such as XOR), the 8 byte
+ * representation is "union"ed with 32 bit values "i0" and "i1", and, on
+ * machines which support it, a 64 bit value "b64".  This data structure,
+ * "C_block", has two problems.  First, alignment restrictions must be
+ * honored.  Second, the byte-order (e.g. little-endian or big-endian) of
+ * the architecture becomes visible.
+ *
+ * The byte-order problem is unfortunate, since on the one hand it is good
+ * to have a machine-independent C_block representation (bits 1..8 in the
+ * first byte, etc.), and on the other hand it is good for the LSB of the
+ * first byte to be the LSB of i0.  We cannot have both these things, so we
+ * currently use the "little-endian" representation and avoid any multi-byte
+ * operations that depend on byte order.  This largely precludes use of the
+ * 64-bit datatype since the relative order of i0 and i1 are unknown.  It
+ * also inhibits grouping the SPE table to look up 12 bits at a time.  (The
+ * 12 bits can be stored in a 16-bit field with 3 low-order zeroes and 1
+ * high-order zero, providing fast indexing into a 64-bit wide SPE.)  On the
+ * other hand, 64-bit datatypes are currently rare, and a 12-bit SPE lookup
+ * requires a 128 kilobyte table, so perhaps this is not a big loss.
+ *
+ * Permutation representation (Jim Gillogly):
+ *
+ * A transformation is defined by its effect on each of the 8 bytes of the
+ * 64-bit input.  For each byte we give a 64-bit output that has the bits in
+ * the input distributed appropriately.  The transformation is then the OR
+ * of the 8 sets of 64-bits.  This uses 8*256*8 = 16K bytes of storage for
+ * each transformation.  Unless LARGEDATA is defined, however, a more compact
+ * table is used which looks up 16 4-bit "chunks" rather than 8 8-bit chunks.
+ * The smaller table uses 16*16*8 = 2K bytes for each transformation.  This
+ * is slower but tolerable, particularly for password encryption in which
+ * the SPE transformation is iterated many times.  The small tables total 9K
+ * bytes, the large tables total 72K bytes.
+ *
+ * The transformations used are:
+ * IE3264: MSB->LSB conversion, initial permutation, and expansion.
+ *     This is done by collecting the 32 even-numbered bits and applying
+ *     a 32->64 bit transformation, and then collecting the 32 odd-numbered
+ *     bits and applying the same transformation.  Since there are only
+ *     32 input bits, the IE3264 transformation table is half the size of
+ *     the usual table.
+ * CF6464: Compression, final permutation, and LSB->MSB conversion.
+ *     This is done by two trivial 48->32 bit compressions to obtain
+ *     a 64-bit block (the bit numbering is given in the "CIFP" table)
+ *     followed by a 64->64 bit "cleanup" transformation.  (It would
+ *     be possible to group the bits in the 64-bit block so that 2
+ *     identical 32->32 bit transformations could be used instead,
+ *     saving a factor of 4 in space and possibly 2 in time, but
+ *     byte-ordering and other complications rear their ugly head.
+ *     Similar opportunities/problems arise in the key schedule
+ *     transforms.)
+ * PC1ROT: MSB->LSB, PC1 permutation, rotate, and PC2 permutation.
+ *     This admittedly baroque 64->64 bit transformation is used to
+ *     produce the first code (in 8*(6+2) format) of the key schedule.
+ * PC2ROT[0]: Inverse PC2 permutation, rotate, and PC2 permutation.
+ *     It would be possible to define 15 more transformations, each
+ *     with a different rotation, to generate the entire key schedule.
+ *     To save space, however, we instead permute each code into the
+ *     next by using a transformation that "undoes" the PC2 permutation,
+ *     rotates the code, and then applies PC2.  Unfortunately, PC2
+ *     transforms 56 bits into 48 bits, dropping 8 bits, so PC2 is not
+ *     invertible.  We get around that problem by using a modified PC2
+ *     which retains the 8 otherwise-lost bits in the unused low-order
+ *     bits of each byte.  The low-order bits are cleared when the
+ *     codes are stored into the key schedule.
+ * PC2ROT[1]: Same as PC2ROT[0], but with two rotations.
+ *     This is faster than applying PC2ROT[0] twice,
+ *
+ * The Bell Labs "salt" (Bob Baldwin):
+ *
+ * The salting is a simple permutation applied to the 48-bit result of E.
+ * Specifically, if bit i (1 <= i <= 24) of the salt is set then bits i and
+ * i+24 of the result are swapped.  The salt is thus a 24 bit number, with
+ * 16777216 possible values.  (The original salt was 12 bits and could not
+ * swap bits 13..24 with 36..48.)
+ *
+ * It is possible, but ugly, to warp the SPE table to account for the salt
+ * permutation.  Fortunately, the conditional bit swapping requires only
+ * about four machine instructions and can be done on-the-fly with about an
+ * 8% performance penalty.
+ */
+
+typedef union {
+    unsigned char b[8];
+    struct {
+#if (SIZEOF_LONG == 4)
+       /* long is often faster than a 32-bit bit field */
+       long i0;
+       long i1;
+#else
+       long i0:32;
+       long i1:32;
+#endif
+    } b32;
+#if defined(B64)
+    B64 b64;
+#endif
+} C_block;
+
+/*
+ * Convert twenty-four-bit long in host-order
+ * to six bits (and 2 low-order zeroes) per char little-endian format.
+ */
+#define        TO_SIX_BIT(rslt, src) {                                         \
+               C_block cvt;                                            \
+               cvt.b[0] = (unsigned char) src; src >>= 6;              \
+               cvt.b[1] = (unsigned char) src; src >>= 6;              \
+               cvt.b[2] = (unsigned char) src; src >>= 6;              \
+               cvt.b[3] = (unsigned char) src;                         \
+               rslt = (cvt.b32.i0 & 0x3f3f3f3fL) << 2;                 \
+       }
+
+/*
+ * These macros may someday permit efficient use of 64-bit integers.
+ */
+#define        ZERO(d,d0,d1)                   d0 = 0, d1 = 0
+#define        LOAD(d,d0,d1,bl)                d0 = (bl).b32.i0, d1 = (bl).b32.i1
+#define        LOADREG(d,d0,d1,s,s0,s1)        d0 = s0, d1 = s1
+#define        OR(d,d0,d1,bl)                  d0 |= (bl).b32.i0, d1 |= (bl).b32.i1
+#define        STORE(s,s0,s1,bl)               (bl).b32.i0 = (s0), (bl).b32.i1 = (s1)
+#define        DCL_BLOCK(d,d0,d1)              long d0, d1
+
+#if defined(LARGEDATA)
+       /* Waste memory like crazy.  Also, do permutations in line */
+#define        LGCHUNKBITS     3
+#define        CHUNKBITS       (1<<LGCHUNKBITS)
+#define        PERM6464(d,d0,d1,cpp,p)                         \
+       LOAD(d,d0,d1,(p)[(0<<CHUNKBITS)+(cpp)[0]]);             \
+       OR (d,d0,d1,(p)[(1<<CHUNKBITS)+(cpp)[1]]);              \
+       OR (d,d0,d1,(p)[(2<<CHUNKBITS)+(cpp)[2]]);              \
+       OR (d,d0,d1,(p)[(3<<CHUNKBITS)+(cpp)[3]]);              \
+       OR (d,d0,d1,(p)[(4<<CHUNKBITS)+(cpp)[4]]);              \
+       OR (d,d0,d1,(p)[(5<<CHUNKBITS)+(cpp)[5]]);              \
+       OR (d,d0,d1,(p)[(6<<CHUNKBITS)+(cpp)[6]]);              \
+       OR (d,d0,d1,(p)[(7<<CHUNKBITS)+(cpp)[7]]);
+#define        PERM3264(d,d0,d1,cpp,p)                         \
+       LOAD(d,d0,d1,(p)[(0<<CHUNKBITS)+(cpp)[0]]);             \
+       OR (d,d0,d1,(p)[(1<<CHUNKBITS)+(cpp)[1]]);              \
+       OR (d,d0,d1,(p)[(2<<CHUNKBITS)+(cpp)[2]]);              \
+       OR (d,d0,d1,(p)[(3<<CHUNKBITS)+(cpp)[3]]);
+#else
+       /* "small data" */
+#define        LGCHUNKBITS     2
+#define        CHUNKBITS       (1<<LGCHUNKBITS)
+#define        PERM6464(d,d0,d1,cpp,p)                         \
+       { C_block tblk; permute(cpp,&tblk,p,8); LOAD (d,d0,d1,tblk); }
+#define        PERM3264(d,d0,d1,cpp,p)                         \
+       { C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); }
+
+STATIC void
+permute(unsigned char *cp, C_block *out, C_block *p, int chars_in)
+{
+    DCL_BLOCK(D, D0, D1);
+    C_block *tp;
+    int t;
+
+    ZERO(D, D0, D1);
+    do {
+       t = *cp++;
+       tp = &p[t & 0xf];
+       OR(D, D0, D1, *tp);
+       p += (1 << CHUNKBITS);
+       tp = &p[t >> 4];
+       OR(D, D0, D1, *tp);
+       p += (1 << CHUNKBITS);
+    } while (--chars_in > 0);
+    STORE(D, D0, D1, *out);
+}
+#endif /* LARGEDATA */
+
+STATIC void init_des(void);
+STATIC void init_perm(C_block [64 / CHUNKBITS][1 << CHUNKBITS],
+                     unsigned char [64], int, int);
+STATIC int des_setkey(const char *key);
+STATIC int des_cipher(const char *in, char *out, long salt, int num_iter);
+
+
+
+/* =====  (mostly) Standard DES Tables ==================== */
+
+static unsigned char IP[] = {  /* initial permutation */
+    58, 50, 42, 34, 26, 18, 10, 2,
+    60, 52, 44, 36, 28, 20, 12, 4,
+    62, 54, 46, 38, 30, 22, 14, 6,
+    64, 56, 48, 40, 32, 24, 16, 8,
+    57, 49, 41, 33, 25, 17, 9, 1,
+    59, 51, 43, 35, 27, 19, 11, 3,
+    61, 53, 45, 37, 29, 21, 13, 5,
+    63, 55, 47, 39, 31, 23, 15, 7,
+};
+
+/* The final permutation is the inverse of IP - no table is necessary */
+
+static unsigned char ExpandTr[] = {    /* expansion operation */
+    32, 1, 2, 3, 4, 5,
+    4, 5, 6, 7, 8, 9,
+    8, 9, 10, 11, 12, 13,
+    12, 13, 14, 15, 16, 17,
+    16, 17, 18, 19, 20, 21,
+    20, 21, 22, 23, 24, 25,
+    24, 25, 26, 27, 28, 29,
+    28, 29, 30, 31, 32, 1,
+};
+
+static unsigned char PC1[] = { /* permuted choice table 1 */
+    57, 49, 41, 33, 25, 17, 9,
+    1, 58, 50, 42, 34, 26, 18,
+    10, 2, 59, 51, 43, 35, 27,
+    19, 11, 3, 60, 52, 44, 36,
+
+    63, 55, 47, 39, 31, 23, 15,
+    7, 62, 54, 46, 38, 30, 22,
+    14, 6, 61, 53, 45, 37, 29,
+    21, 13, 5, 28, 20, 12, 4,
+};
+
+static unsigned char Rotates[] = {     /* PC1 rotation schedule */
+    1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1,
+};
+
+/* note: each "row" of PC2 is left-padded with bits that make it invertible */
+static unsigned char PC2[] = { /* permuted choice table 2 */
+    9, 18, 14, 17, 11, 24, 1, 5,
+    22, 25, 3, 28, 15, 6, 21, 10,
+    35, 38, 23, 19, 12, 4, 26, 8,
+    43, 54, 16, 7, 27, 20, 13, 2,
+
+    0, 0, 41, 52, 31, 37, 47, 55,
+    0, 0, 30, 40, 51, 45, 33, 48,
+    0, 0, 44, 49, 39, 56, 34, 53,
+    0, 0, 46, 42, 50, 36, 29, 32,
+};
+
+static unsigned char S[8][64] = {      /* 48->32 bit substitution tables */
+    /* S[1]                 */
+    {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
+     0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
+     4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
+     15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,},
+    /* S[2]                 */
+    {15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
+     3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
+     0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
+     13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,},
+    /* S[3]                 */
+    {10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
+     13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
+     13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
+     1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,},
+    /* S[4]                 */
+    {7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
+     13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
+     10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
+     3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,},
+    /* S[5]                 */
+    {2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
+     14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
+     4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
+     11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,},
+    /* S[6]                 */
+    {12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
+     10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
+     9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
+     4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,},
+    /* S[7]                 */
+    {4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
+     13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
+     1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
+     6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,},
+    /* S[8]                 */
+    {13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
+     1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
+     7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
+     2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11,}
+};
+
+static unsigned char P32Tr[] = {       /* 32-bit permutation function */
+    16, 7, 20, 21,
+    29, 12, 28, 17,
+    1, 15, 23, 26,
+    5, 18, 31, 10,
+    2, 8, 24, 14,
+    32, 27, 3, 9,
+    19, 13, 30, 6,
+    22, 11, 4, 25,
+};
+
+static unsigned char CIFP[] = {        /* compressed/interleaved permutation */
+    1, 2, 3, 4, 17, 18, 19, 20,
+    5, 6, 7, 8, 21, 22, 23, 24,
+    9, 10, 11, 12, 25, 26, 27, 28,
+    13, 14, 15, 16, 29, 30, 31, 32,
+
+    33, 34, 35, 36, 49, 50, 51, 52,
+    37, 38, 39, 40, 53, 54, 55, 56,
+    41, 42, 43, 44, 57, 58, 59, 60,
+    45, 46, 47, 48, 61, 62, 63, 64,
+};
+
+static unsigned char itoa64[] =        /* 0..63 => ascii-64 */
+    "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+
+/* =====  Tables that are initialized at run time  ==================== */
+
+
+static unsigned char a64toi[128];      /* ascii-64 => 0..63 */
+
+/* Initial key schedule permutation */
+static C_block PC1ROT[64 / CHUNKBITS][1 << CHUNKBITS];
+
+/* Subsequent key schedule rotation permutations */
+static C_block PC2ROT[2][64 / CHUNKBITS][1 << CHUNKBITS];
+
+/* Initial permutation/expansion table */
+static C_block IE3264[32 / CHUNKBITS][1 << CHUNKBITS];
+
+/* Table that combines the S, P, and E operations.  */
+static long SPE[2][8][64];
+
+/* compressed/interleaved => final permutation table */
+static C_block CF6464[64 / CHUNKBITS][1 << CHUNKBITS];
+
+
+/* ==================================== */
+
+
+static C_block constdatablock; /* encryption constant */
+static char cryptresult[1 + 4 + 4 + 11 + 1];   /* encrypted result */
+
+/*
+ * Return a pointer to static data consisting of the "setting"
+ * followed by an encryption produced by the "key" and "setting".
+ */
+char *
+crypt(const char *key, const char *setting)
+{
+    char *encp;
+    long i;
+    int t;
+    long salt;
+    int num_iter, salt_size;
+    C_block keyblock, rsltblock;
+
+
+    for (i = 0; i < 8; i++) {
+       if ((t = 2 * (unsigned char)(*key)) != 0)
+           key++;
+       keyblock.b[i] = t;
+    }
+    if (des_setkey((char *)keyblock.b))        /* also initializes "a64toi" */
+       return (NULL);
+
+    encp = &cryptresult[0];
+    switch (*setting) {
+    case '_':                  /* was EFMT1 */
+       /*
+        * Involve the rest of the password 8 characters at a time.
+        */
+       while (*key) {
+           if (des_cipher((char *)&keyblock, (char *)&keyblock, 0L, 1))
+               return (NULL);
+           for (i = 0; i < 8; i++) {
+               if ((t = 2 * (unsigned char)(*key)) != 0)
+                   key++;
+               keyblock.b[i] ^= t;
+           }
+           if (des_setkey((char *)keyblock.b))
+               return (NULL);
+       }
+
+       *encp++ = *setting++;
+
+       /* get iteration count */
+       num_iter = 0;
+       for (i = 4; --i >= 0;) {
+           if ((t = (unsigned char)setting[i]) == '\0')
+               t = '.';
+           encp[i] = t;
+           num_iter = (num_iter << 6) | a64toi[t];
+       }
+       setting += 4;
+       encp += 4;
+       salt_size = 4;
+       break;
+    default:
+       num_iter = 25;
+       salt_size = 2;
+    }
+
+    salt = 0;
+    for (i = salt_size; --i >= 0;) {
+       if ((t = (unsigned char)setting[i]) == '\0')
+           t = '.';
+       encp[i] = t;
+       salt = (salt << 6) | a64toi[t];
+    }
+    encp += salt_size;
+    if (des_cipher
+       ((char *)&constdatablock, (char *)&rsltblock, salt, num_iter))
+       return (NULL);
+
+    /*
+     * Encode the 64 cipher bits as 11 ascii characters.
+     */
+    i = ((long)((rsltblock.b[0] << 8) | rsltblock.b[1]) << 8) | rsltblock.
+       b[2];
+    encp[3] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[2] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[1] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[0] = itoa64[i];
+    encp += 4;
+    i = ((long)((rsltblock.b[3] << 8) | rsltblock.b[4]) << 8) | rsltblock.
+       b[5];
+    encp[3] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[2] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[1] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[0] = itoa64[i];
+    encp += 4;
+    i = ((long)((rsltblock.b[6]) << 8) | rsltblock.b[7]) << 2;
+    encp[2] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[1] = itoa64[i & 0x3f];
+    i >>= 6;
+    encp[0] = itoa64[i];
+
+    encp[3] = 0;
+
+    return (cryptresult);
+}
+
+
+/*
+ * The Key Schedule, filled in by des_setkey() or setkey().
+ */
+#define        KS_SIZE 16
+static C_block KS[KS_SIZE];
+
+/*
+ * Set up the key schedule from the key.
+ */
+STATIC int
+des_setkey(const char *key)
+{
+    DCL_BLOCK(K, K0, K1);
+    C_block *ptabp;
+    int i;
+    static int des_ready = 0;
+
+    if (!des_ready) {
+       init_des();
+       des_ready = 1;
+    }
+
+    PERM6464(K, K0, K1, (unsigned char *)key, (C_block *) PC1ROT);
+    key = (char *)&KS[0];
+    STORE(K & ~0x03030303L, K0 & ~0x03030303L, K1, *(C_block *) key);
+    for (i = 1; i < 16; i++) {
+       key += sizeof(C_block);
+       STORE(K, K0, K1, *(C_block *) key);
+       ptabp = (C_block *) PC2ROT[Rotates[i] - 1];
+       PERM6464(K, K0, K1, (unsigned char *)key, ptabp);
+       STORE(K & ~0x03030303L, K0 & ~0x03030303L, K1, *(C_block *) key);
+    }
+    return (0);
+}
+
+/*
+ * Encrypt (or decrypt if num_iter < 0) the 8 chars at "in" with abs(num_iter)
+ * iterations of DES, using the the given 24-bit salt and the pre-computed key
+ * schedule, and store the resulting 8 chars at "out" (in == out is permitted).
+ *
+ * NOTE: the performance of this routine is critically dependent on your
+ * compiler and machine architecture.
+ */
+STATIC int
+des_cipher(const char *in, char *out, long salt, int num_iter)
+{
+    /* variables that we want in registers, most important first */
+#if defined(pdp11)
+    int j;
+#endif
+    long L0, L1, R0, R1, k;
+    C_block *kp;
+    int ks_inc, loop_count;
+    C_block B;
+
+    L0 = salt;
+    TO_SIX_BIT(salt, L0);      /* convert to 4*(6+2) format */
+
+#if defined(vax) || defined(pdp11)
+    salt = ~salt;              /* "x &~ y" is faster than "x & y". */
+#define        SALT (~salt)
+#else
+#define        SALT salt
+#endif
+
+#if defined(MUST_ALIGN)
+    B.b[0] = in[0];
+    B.b[1] = in[1];
+    B.b[2] = in[2];
+    B.b[3] = in[3];
+    B.b[4] = in[4];
+    B.b[5] = in[5];
+    B.b[6] = in[6];
+    B.b[7] = in[7];
+    LOAD(L, L0, L1, B);
+#else
+    LOAD(L, L0, L1, *(C_block *) in);
+#endif
+    LOADREG(R, R0, R1, L, L0, L1);
+    L0 &= 0x55555555L;
+    L1 &= 0x55555555L;
+    L0 = (L0 << 1) | L1;       /* L0 is the even-numbered input bits */
+    R0 &= 0xaaaaaaaaL;
+    R1 = (R1 >> 1) & 0x55555555L;
+    L1 = R0 | R1;              /* L1 is the odd-numbered input bits */
+    STORE(L, L0, L1, B);
+    PERM3264(L, L0, L1, B.b, (C_block *) IE3264);      /* even bits */
+    PERM3264(R, R0, R1, B.b + 4, (C_block *) IE3264);  /* odd bits */
+
+    if (num_iter >= 0) {       /* encryption */
+       kp = &KS[0];
+       ks_inc = sizeof(*kp);
+    } else {                   /* decryption */
+       num_iter = -num_iter;
+       kp = &KS[KS_SIZE - 1];
+       ks_inc = -((long)sizeof(*kp));
+    }
+
+    while (--num_iter >= 0) {
+       loop_count = 8;
+       do {
+
+#define        SPTAB(t, i)     (*(long *)((unsigned char *)t + i*(sizeof(long)/4)))
+#if defined(gould)
+           /* use this if B.b[i] is evaluated just once ... */
+#define        DOXOR(x,y,i)    x^=SPTAB(SPE[0][i],B.b[i]); y^=SPTAB(SPE[1][i],B.b[i]);
+#else
+#if defined(pdp11)
+           /* use this if your "long" int indexing is slow */
+#define        DOXOR(x,y,i)    j=B.b[i]; x^=SPTAB(SPE[0][i],j); y^=SPTAB(SPE[1][i],j);
+#else
+           /* use this if "k" is allocated to a register ... */
+#define        DOXOR(x,y,i)    k=B.b[i]; x^=SPTAB(SPE[0][i],k); y^=SPTAB(SPE[1][i],k);
+#endif
+#endif
+
+#define        CRUNCH(p0, p1, q0, q1)  \
+                       k = (q0 ^ q1) & SALT;   \
+                       B.b32.i0 = k ^ q0 ^ kp->b32.i0;         \
+                       B.b32.i1 = k ^ q1 ^ kp->b32.i1;         \
+                       kp = (C_block *)((char *)kp+ks_inc);    \
+                                                       \
+                       DOXOR(p0, p1, 0);               \
+                       DOXOR(p0, p1, 1);               \
+                       DOXOR(p0, p1, 2);               \
+                       DOXOR(p0, p1, 3);               \
+                       DOXOR(p0, p1, 4);               \
+                       DOXOR(p0, p1, 5);               \
+                       DOXOR(p0, p1, 6);               \
+                       DOXOR(p0, p1, 7);
+
+           CRUNCH(L0, L1, R0, R1);
+           CRUNCH(R0, R1, L0, L1);
+       } while (--loop_count != 0);
+       kp = (C_block *) ((char *)kp - (ks_inc * KS_SIZE));
+
+
+       /* swap L and R */
+       L0 ^= R0;
+       L1 ^= R1;
+       R0 ^= L0;
+       R1 ^= L1;
+       L0 ^= R0;
+       L1 ^= R1;
+    }
+
+    /* store the encrypted (or decrypted) result */
+    L0 = ((L0 >> 3) & 0x0f0f0f0fL) | ((L1 << 1) & 0xf0f0f0f0L);
+    L1 = ((R0 >> 3) & 0x0f0f0f0fL) | ((R1 << 1) & 0xf0f0f0f0L);
+    STORE(L, L0, L1, B);
+    PERM6464(L, L0, L1, B.b, (C_block *) CF6464);
+#if defined(MUST_ALIGN)
+    STORE(L, L0, L1, B);
+    out[0] = B.b[0];
+    out[1] = B.b[1];
+    out[2] = B.b[2];
+    out[3] = B.b[3];
+    out[4] = B.b[4];
+    out[5] = B.b[5];
+    out[6] = B.b[6];
+    out[7] = B.b[7];
+#else
+    STORE(L, L0, L1, *(C_block *) out);
+#endif
+    return (0);
+}
+
+
+/*
+ * Initialize various tables.  This need only be done once.  It could even be
+ * done at compile time, if the compiler were capable of that sort of thing.
+ */
+STATIC void
+init_des(void)
+{
+    int i, j;
+    long k;
+    int tableno;
+    static unsigned char perm[64], tmp32[32];  /* "static" for speed */
+
+    /*
+     * table that converts chars "./0-9A-Za-z"to integers 0-63.
+     */
+    for (i = 0; i < 64; i++)
+       a64toi[itoa64[i]] = i;
+
+    /*
+     * PC1ROT - bit reverse, then PC1, then Rotate, then PC2.
+     */
+    for (i = 0; i < 64; i++)
+       perm[i] = 0;
+    for (i = 0; i < 64; i++) {
+       if ((k = PC2[i]) == 0)
+           continue;
+       k += Rotates[0] - 1;
+       if ((k % 28) < Rotates[0])
+           k -= 28;
+       k = PC1[k];
+       if (k > 0) {
+           k--;
+           k = (k | 07) - (k & 07);
+           k++;
+       }
+       perm[i] = (unsigned char)k;
+    }
+#ifdef CRYPT_DEBUG
+    prtab("pc1tab", perm, 8);
+#endif
+    init_perm(PC1ROT, perm, 8, 8);
+
+    /*
+     * PC2ROT - PC2 inverse, then Rotate (once or twice), then PC2.
+     */
+    for (j = 0; j < 2; j++) {
+       unsigned char pc2inv[64];
+       for (i = 0; i < 64; i++)
+           perm[i] = pc2inv[i] = 0;
+       for (i = 0; i < 64; i++) {
+           if ((k = PC2[i]) == 0)
+               continue;
+           pc2inv[k - 1] = i + 1;
+       }
+       for (i = 0; i < 64; i++) {
+           if ((k = PC2[i]) == 0)
+               continue;
+           k += j;
+           if ((k % 28) <= j)
+               k -= 28;
+           perm[i] = pc2inv[k];
+       }
+#ifdef CRYPT_DEBUG
+       prtab("pc2tab", perm, 8);
+#endif
+       init_perm(PC2ROT[j], perm, 8, 8);
+    }
+
+    /*
+     * Bit reverse, then initial permutation, then expansion.
+     */
+    for (i = 0; i < 8; i++) {
+       for (j = 0; j < 8; j++) {
+           k = (j < 2) ? 0 : IP[ExpandTr[i * 6 + j - 2] - 1];
+           if (k > 32)
+               k -= 32;
+           else if (k > 0)
+               k--;
+           if (k > 0) {
+               k--;
+               k = (k | 07) - (k & 07);
+               k++;
+           }
+           perm[i * 8 + j] = (unsigned char)k;
+       }
+    }
+#ifdef CRYPT_DEBUG
+    prtab("ietab", perm, 8);
+#endif
+    init_perm(IE3264, perm, 4, 8);
+
+    /*
+     * Compression, then final permutation, then bit reverse.
+     */
+    for (i = 0; i < 64; i++) {
+       k = IP[CIFP[i] - 1];
+       if (k > 0) {
+           k--;
+           k = (k | 07) - (k & 07);
+           k++;
+       }
+       perm[k - 1] = i + 1;
+    }
+#ifdef CRYPT_DEBUG
+    prtab("cftab", perm, 8);
+#endif
+    init_perm(CF6464, perm, 8, 8);
+
+    /*
+     * SPE table
+     */
+    for (i = 0; i < 48; i++)
+       perm[i] = P32Tr[ExpandTr[i] - 1];
+    for (tableno = 0; tableno < 8; tableno++) {
+       for (j = 0; j < 64; j++) {
+           k = (((j >> 0) & 01) << 5) | (((j >> 1) & 01) << 3) |
+               (((j >> 2) & 01) << 2) | (((j >> 3) & 01) << 1) |
+               (((j >> 4) & 01) << 0) | (((j >> 5) & 01) << 4);
+           k = S[tableno][k];
+           k = (((k >> 3) & 01) << 0) | (((k >> 2) & 01) << 1) |
+               (((k >> 1) & 01) << 2) | (((k >> 0) & 01) << 3);
+           for (i = 0; i < 32; i++)
+               tmp32[i] = 0;
+           for (i = 0; i < 4; i++)
+               tmp32[4 * tableno + i] = (k >> i) & 01;
+           k = 0;
+           for (i = 24; --i >= 0;)
+               k = (k << 1) | tmp32[perm[i] - 1];
+           TO_SIX_BIT(SPE[0][tableno][j], k);
+           k = 0;
+           for (i = 24; --i >= 0;)
+               k = (k << 1) | tmp32[perm[i + 24] - 1];
+           TO_SIX_BIT(SPE[1][tableno][j], k);
+       }
+    }
+}
+
+/*
+ * Initialize "perm" to represent transformation "p", which rearranges
+ * (perhaps with expansion and/or contraction) one packed array of bits
+ * (of size "chars_in" characters) into another array (of size "chars_out"
+ * characters).
+ *
+ * "perm" must be all-zeroes on entry to this routine.
+ */
+STATIC void
+init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS],
+         unsigned char p[64], int chars_in, int chars_out)
+{
+    int i, j, k, l;
+
+    for (k = 0; k < chars_out * 8; k++) {      /* each output bit position */
+       l = p[k] - 1;           /* where this bit comes from */
+       if (l < 0)
+           continue;           /* output bit is always 0 */
+       i = l >> LGCHUNKBITS;   /* which chunk this bit comes from */
+       l = 1 << (l & (CHUNKBITS - 1)); /* mask for this bit */
+       for (j = 0; j < (1 << CHUNKBITS); j++) {        /* each chunk value */
+           if ((j & l) != 0)
+               perm[i][j].b[k >> 3] |= 1 << (k & 07);
+       }
+    }
+}
+
+/*
+ * "setkey" routine (for backwards compatibility)
+ */
+#if 0                          /* static and doesn't appear to be referenced */
+STATIC int
+setkey(key)
+     const char *key;
+{
+    int i, j, k;
+    C_block keyblock;
+
+    for (i = 0; i < 8; i++) {
+       k = 0;
+       for (j = 0; j < 8; j++) {
+           k <<= 1;
+           k |= (unsigned char)*key++;
+       }
+       keyblock.b[i] = k;
+    }
+    return (des_setkey((char *)keyblock.b));
+}
+#endif
+
+#if 0
+/*
+ * "encrypt" routine (for backwards compatibility)
+ */
+int
+encrypt(block, flag)
+     char *block;
+     int flag;
+{
+    int i, j, k;
+    C_block cblock;
+
+    for (i = 0; i < 8; i++) {
+       k = 0;
+       for (j = 0; j < 8; j++) {
+           k <<= 1;
+           k |= (unsigned char)*block++;
+       }
+       cblock.b[i] = k;
+    }
+    if (des_cipher((char *)&cblock, (char *)&cblock, 0L, (flag ? -1 : 1)))
+       return (1);
+    for (i = 7; i >= 0; i--) {
+       k = cblock.b[i];
+       for (j = 7; j >= 0; j--) {
+           *--block = k & 01;
+           k >>= 1;
+       }
+    }
+    return (0);
+}
+#endif
+
+#ifdef CRYPT_DEBUG
+STATIC
+prtab(char *s, unsigned char *t, int num_rows)
+{
+    int i, j;
+
+    (void)printf("%s:\n", s);
+    for (i = 0; i < num_rows; i++) {
+       for (j = 0; j < 8; j++) {
+           (void)printf("%3d", t[i * 8 + j]);
+       }
+       (void)printf("\n");
+    }
+    (void)printf("\n");
+}
+#endif
diff --git a/src/kauth/crypt.h b/src/kauth/crypt.h
new file mode 100644 (file)
index 0000000..ec168fe
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __CRYPT_H_ENV__
+#define __CRYPT_H_ENV__ 1
+
+char *crypt(char *, char *);
+
+#endif /* __CRYPT_H_ENV__ */
index 15082e5794cceb12f7d4a72e63b9898c2043753a..55b47bc24b2303e5dd00ac0b38a38dc15a4c04ac 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 
-#include <des.h>
+#include <hcrypto/des.h>
 #include <afs/com_err.h>
 #include <afs/auth.h>
 #include <rx/rxkad.h>
@@ -42,7 +42,7 @@ main(int argc, char *argv[])
     }
     if (ka_ReadBytes(argv[1], key, sizeof(key)) != 8)
        printf("Key must be 8 bytes long\n");
-    if (!des_check_key_parity(key) || des_is_weak_key(key)) {
+    if (!DES_check_key_parity(charptr_to_cblock(key)) || DES_is_weak_key(charptr_to_cblock(key))) {
        afs_com_err(whoami, KABADKEY, "server's key for decoding ticket is bad");
        exit(1);
     }
index 2e370954385bf87f9bcc3adac8a6140fb9b317e2..365994f94c39b07b81a26f6ca381e26355f8438d 100644 (file)
 
 #include <roken.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#endif
+
 #include <afs/stds.h>
 #include <errno.h>
 #include "kauth.h"
 #include <sys/file.h>
 #endif
 #include <stdio.h>
+
+#define HC_DEPRECATED
+#include <hcrypto/des.h>
+
 #include <lock.h>
 #include <ubik.h>
 #include <lwp.h>
-#include <des.h>
-#include <des_prototypes.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
@@ -41,6 +47,7 @@
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <afs/com_err.h>
+
 #include "kautils.h"
 #include "kaserver.h"
 #include "kalog.h"
@@ -150,12 +157,12 @@ get_time(Date *timeP,
        if (to) {               /* check if auto cpw is disabled */
            if (!(ntohl(tentry.flags) & KAFNOCPW)) {
                memcpy(&key, &random_value[0], sizeof(key));
-               des_fixup_key_parity(ktc_to_cblock(&key));
+               DES_set_odd_parity(ktc_to_cblock(&key));
                code =
                    set_password(tt, KA_ADMIN_NAME, KA_ADMIN_INST, &key, 0,
                                 0);
                if (code == 0) {
-                   des_init_random_number_generator(ktc_to_cblock(&key));
+                   DES_init_random_number_generator(ktc_to_cblock(&key));
                    ka_ConvertBytes(buf, sizeof(buf), (char *)&key,
                                    sizeof(key));
                    es_Report("New Admin key is %s\n", buf);
@@ -174,7 +181,7 @@ get_time(Date *timeP,
        if (to) {               /* check if auto cpw is disabled */
            if (!(ntohl(tentry.flags) & KAFNOCPW)) {
                memcpy(&key, &random_value[2], sizeof(key));
-               des_fixup_key_parity(ktc_to_cblock(&key));
+               DES_set_odd_parity(ktc_to_cblock(&key));
                code = set_password(tt, KA_TGS_NAME, lrealm, &key, 0, 0);
                if (code == 0) {
                    ka_ConvertBytes(buf, sizeof(buf), (char *)&key,
@@ -221,14 +228,14 @@ initialize_database(struct ubik_trans *tt)
     int code;
 
     gettimeofday((struct timeval *)&key, 0);   /* this is just a cheap seed key */
-    des_fixup_key_parity(ktc_to_cblock(&key));
-    des_init_random_number_generator(ktc_to_cblock(&key));
-    if ((code = des_random_key(ktc_to_cblock(&key)))
+    DES_set_odd_parity(ktc_to_cblock(&key));
+    DES_init_random_number_generator(ktc_to_cblock(&key));
+    if ((code = DES_new_random_key(ktc_to_cblock(&key)))
        || (code =
            create_user(tt, KA_ADMIN_NAME, KA_ADMIN_INST, &key, 0,
                        KAFNORMAL | KAFNOSEAL | KAFNOTGS)))
        return code;
-    if ((code = des_random_key(ktc_to_cblock(&key)))
+    if ((code = DES_new_random_key(ktc_to_cblock(&key)))
        || (code =
            create_user(tt, KA_TGS_NAME, lrealm, &key, 0,
                        KAFNORMAL | KAFNOSEAL | KAFNOTGS)))
@@ -292,7 +299,7 @@ init_kaprocs(const char *lclpath, int initFlags)
             code);
        return code;
     }
-    des_init_random_number_generator(ktc_to_cblock(&key));
+    DES_init_random_number_generator(ktc_to_cblock(&key));
 
     code = ubik_EndTrans(tt);
     if (code) {
@@ -630,7 +637,8 @@ kamCreateUser(struct rx_call *call, char *aname, char *ainstance,
     afs_int32 caller;          /* Disk offset of caller's entry */
 
     COUNT_REQ(CreateUser);
-    if (!des_check_key_parity(EncryptionKey_to_cblock(&ainitpw)) || des_is_weak_key(EncryptionKey_to_cblock(&ainitpw)))
+    if (!DES_check_key_parity(EncryptionKey_to_cblock(&ainitpw)) ||
+       DES_is_weak_key(EncryptionKey_to_cblock(&ainitpw)))
        return KABADKEY;
     if (!name_instance_legal(aname, ainstance))
        return KABADNAME;
@@ -678,7 +686,7 @@ ChangePassWord(struct rx_call *call, char *aname, char *ainstance,
     char *answer;              /* where answer is to be put */
     int answer_len;            /* length of answer packet */
     afs_int32 kvno;            /* requested key version number */
-    des_key_schedule user_schedule;    /* key schedule for user's key */
+    DES_key_schedule user_schedule;    /* key schedule for user's key */
     Date request_time;         /* time request originated */
 
     COUNT_REQ(ChangePassword);
@@ -703,10 +711,10 @@ ChangePassWord(struct rx_call *call, char *aname, char *ainstance,
     }
 
     /* decrypt request w/ user password */
-    if ((code = des_key_sched(ktc_to_cblock(&tentry.key), user_schedule)))
+    if ((code = DES_key_sched(ktc_to_cblock(&tentry.key), &user_schedule)))
        es_Report("In KAChangePassword: key_sched returned %d\n", code);
-    des_pcbc_encrypt(arequest->SeqBody, &request,
-                    min(arequest->SeqLen, sizeof(request)), user_schedule,
+    DES_pcbc_encrypt(arequest->SeqBody, &request,
+                    min(arequest->SeqLen, sizeof(request)), &user_schedule,
                     ktc_to_cblockptr(&tentry.key), DECRYPT);
 
     /* validate the request */
@@ -738,8 +746,8 @@ ChangePassWord(struct rx_call *call, char *aname, char *ainstance,
     answer += sizeof(Date);
     memcpy(answer, KA_CPW_ANS_LABEL, KA_LABELSIZE);
 
-    des_pcbc_encrypt(oanswer->SeqBody, oanswer->SeqBody, answer_len,
-                    user_schedule, ktc_to_cblockptr(&tentry.key), ENCRYPT);
+    DES_pcbc_encrypt(oanswer->SeqBody, oanswer->SeqBody, answer_len,
+                    &user_schedule, ktc_to_cblockptr(&tentry.key), ENCRYPT);
 
     code = set_password(tt, aname, ainstance, &request.newpw, kvno, 0);
     if (code) {
@@ -890,7 +898,8 @@ kamSetPassword(struct rx_call *call, char *aname, char *ainstance,
     COUNT_REQ(SetPassword);
     if (akvno > MAXKAKVNO)
        return KABADARGUMENT;
-    if (!des_check_key_parity(EncryptionKey_to_cblock(&apassword)) || des_is_weak_key(EncryptionKey_to_cblock(&apassword)))
+    if (!DES_check_key_parity(EncryptionKey_to_cblock(&apassword)) ||
+       DES_is_weak_key(EncryptionKey_to_cblock(&apassword)))
        return KABADKEY;
 
     if (!name_instance_legal(aname, ainstance))
@@ -1062,7 +1071,7 @@ Authenticate(int version, struct rx_call *call, char *aname, char *ainstance,
     int answer_len;            /* length of answer packet */
     Date answer_time;          /* 1+ request time in network order */
     afs_int32 temp;            /* for htonl conversions */
-    des_key_schedule user_schedule;    /* key schedule for user's key */
+    DES_key_schedule user_schedule;    /* key schedule for user's key */
     afs_int32 tgskvno;         /* key version of service key */
     struct ktc_encryptionKey tgskey;   /* service key for encrypting ticket */
     Date now;
@@ -1101,10 +1110,10 @@ Authenticate(int version, struct rx_call *call, char *aname, char *ainstance,
     save_principal(authPrincipal, aname, ainstance, 0);
 
     /* decrypt request w/ user password */
-    if ((code = des_key_sched(ktc_to_cblock(&tentry.key), user_schedule)))
+    if ((code = DES_key_sched(ktc_to_cblock(&tentry.key), &user_schedule)))
        es_Report("In KAAuthenticate: key_sched returned %d\n", code);
-    des_pcbc_encrypt(arequest->SeqBody, &request,
-                    min(arequest->SeqLen, sizeof(request)), user_schedule,
+    DES_pcbc_encrypt(arequest->SeqBody, &request,
+                    min(arequest->SeqLen, sizeof(request)), &user_schedule,
                     ktc_to_cblockptr(&tentry.key), DECRYPT);
 
     request.time = ntohl(request.time);        /* reorder date */
@@ -1167,7 +1176,7 @@ Authenticate(int version, struct rx_call *call, char *aname, char *ainstance,
     tgskvno = ntohl(server.key_version);
     memcpy(&tgskey, &server.key, sizeof(tgskey));
 
-    code = des_random_key(ktc_to_cblock(&sessionKey));
+    code = DES_new_random_key(ktc_to_cblock(&sessionKey));
     if (code) {
        code = KANOKEYS;
        goto abort;
@@ -1244,8 +1253,8 @@ Authenticate(int version, struct rx_call *call, char *aname, char *ainstance,
        code = KAINTERNALERROR;
        goto abort;
     }
-    des_pcbc_encrypt(oanswer->SeqBody, oanswer->SeqBody, oanswer->SeqLen,
-                    user_schedule, ktc_to_cblockptr(&tentry.key), ENCRYPT);
+    DES_pcbc_encrypt(oanswer->SeqBody, oanswer->SeqBody, oanswer->SeqLen,
+                    &user_schedule, ktc_to_cblockptr(&tentry.key), ENCRYPT);
     code = ubik_EndTrans(tt);
     KALOG(aname, ainstance, sname, sinst, NULL, call->conn->peer->host,
          LOG_AUTHENTICATE);
@@ -1740,7 +1749,7 @@ GetTicket(int version,
     int import, export;
     struct ubik_trans *tt;
     struct ktc_encryptionKey tgskey;
-    des_key_schedule schedule;
+    DES_key_schedule schedule;
     afs_int32 to;
     char name[MAXKTCNAMELEN];
     char instance[MAXKTCNAMELEN];
@@ -1801,7 +1810,7 @@ GetTicket(int version,
            code = KANOAUTH;
        goto abort;
     }
-    code = des_key_sched(ktc_to_cblock(&authSessionKey), schedule);
+    code = DES_key_sched(ktc_to_cblock(&authSessionKey), &schedule);
     if (code) {
        code = KANOAUTH;
        goto abort;
@@ -1819,7 +1828,7 @@ GetTicket(int version,
        goto abort;
     }
 
-    des_ecb_encrypt(atimes->SeqBody, &times, schedule, DECRYPT);
+    DES_ecb_encrypt((DES_cblock *)atimes->SeqBody, (DES_cblock *)&times, &schedule, DECRYPT);
     times.start = ntohl(times.start);
     times.end = ntohl(times.end);
     code = tkt_CheckTimes(times.start, times.end, now);
@@ -1856,7 +1865,7 @@ GetTicket(int version,
     }
     save_principal(tgsServerPrincipal, sname, sinstance, 0);
 
-    code = des_random_key(ktc_to_cblock(&sessionKey));
+    code = DES_new_random_key(ktc_to_cblock(&sessionKey));
     if (code) {
        code = KANOKEYS;
        goto abort;
@@ -1929,8 +1938,8 @@ GetTicket(int version,
        code = KAINTERNALERROR;
        goto abort;
     }
-    des_pcbc_encrypt(oanswer->SeqBody, oanswer->SeqBody, oanswer->SeqLen,
-                    schedule, ktc_to_cblockptr(&authSessionKey), ENCRYPT);
+    DES_pcbc_encrypt(oanswer->SeqBody, oanswer->SeqBody, oanswer->SeqLen,
+                    &schedule, ktc_to_cblockptr(&authSessionKey), ENCRYPT);
     code = ubik_EndTrans(tt);
     KALOG(name, instance, sname, sinstance, (import ? authDomain : NULL),
          call->conn->peer->host, LOG_GETTICKET);
@@ -2145,7 +2154,7 @@ kamGetRandomKey(struct rx_call *call, EncryptionKey *key)
     AFS_UNUSED COUNT_REQ(GetRandomKey);
     if ((code = AwaitInitialization()))
        return code;
-    code = des_random_key(EncryptionKey_to_cblock(key));
+    code = DES_new_random_key(EncryptionKey_to_cblock(key));
     if (code)
        return KANOKEYS;
     return 0;
index 02c91e9738cda49b39fae38db56dcee4719708d1..ae25452316560637f09239b008a904aaf760dd71 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef AFS_SRC_KAUTH_INTERNAL_H
 #define AFS_SRC_KAUTH_INTERNAL_H
 
+#include <hcrypto/des.h>
+
 /* admin_tools.c */
 extern afs_int32 ka_AdminInteractive(int cmd_argc, char *cmd_argv[]);
 
@@ -54,9 +56,9 @@ extern afs_int32 krb_write_ticket_file(char *realm);
 /* krb_udp.c */
 extern afs_int32 init_krb_udp(void);
 
-static_inline unsigned char *
+static_inline DES_cblock *
 EncryptionKey_to_cblock(EncryptionKey *key) {
-    return (unsigned char *)key;
+    return (DES_cblock *)key;
 }
 
 static_inline struct ktc_encryptionKey *
index 5eaedbc00598619ec0aae47ecb89d889bec62ee2..8dd6242a1351d7e6345ca1d53388567f9258309f 100644 (file)
@@ -28,8 +28,7 @@
 #include <ctype.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
-#include <des.h>
-#include <des_prototypes.h>
+#include <hcrypto/des.h>
 #include "kauth.h"
 #include "kautils.h"
 
@@ -143,18 +142,18 @@ umin(afs_uint32 a, afs_uint32 b)
 afs_int32
 ka_KeyCheckSum(char *key, afs_uint32 * cksumP)
 {
-    des_key_schedule s;
-    unsigned char block[8];
+    DES_key_schedule s;
+    DES_cblock block;
     afs_uint32 cksum;
     afs_int32 code;
 
     *cksumP = 0;
     memset(block, 0, 8);
-    code = des_key_sched(charptr_to_cblock(key), s);
+    code = DES_key_sched(charptr_to_cblock(key), &s);
     if (code)
        return KABADKEY;
-    des_ecb_encrypt(block, block, s, ENCRYPT);
-    memcpy(&cksum, block, sizeof(afs_int32));
+    DES_ecb_encrypt(&block, &block, &s, ENCRYPT);
+    memcpy(&cksum, &block, sizeof(afs_int32));
     *cksumP = ntohl(cksum);
     return 0;
 }
index dec459e6b9310fb957df15405c42e508627fcbd1..3b7eaa49488560536bea85ce8fd236233efc3ad3 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __KAUTILS__
 #define __KAUTILS__
 
-#include <des.h>
 #include <afs/auth.h>
 
 #ifndef KAMAJORVERSION
index aa52aec63f2870b9b2f6faea128e7af7e3bacb15..220b4605966528c2f03398033503653d89a66118 100644 (file)
 #endif
 #include <string.h>
 #include <signal.h>
-#include <des.h>
-#include <des_prototypes.h>
 #include <afs/com_err.h>
 #include <afs/auth.h>
 #include <afs/cellconfig.h>
 #include <afs/cmd.h>
+#include <hcrypto/des.h>
+#include <hcrypto/ui.h>
 #include "kauth.h"
 #include "kautils.h"
 #include "kkids.h"
@@ -158,7 +158,7 @@ static afs_int32
 read_pass(char *passwd, int len, char *prompt, int verify)
 {
     afs_int32 code;
-    code = read_pw_string(passwd, len, prompt, verify);
+    code = UI_UTIL_read_pw_string(passwd, len, prompt, verify);
     if (code == -1) {
        getpipepass(passwd, len);
        return 0;
@@ -406,7 +406,7 @@ CommandProc(struct cmd_syndesc *as, void *arock)
        }
     }
     ka_StringToKey(passwd, realm, &key);
-    des_string_to_key(passwd, ktc_to_cblockptr(&mitkey));
+    DES_string_to_key(passwd, ktc_to_cblockptr(&mitkey));
     give_to_child(passwd);
 
     /* Get new password if it wasn't provided. */
@@ -452,7 +452,7 @@ CommandProc(struct cmd_syndesc *as, void *arock)
        npasswd[8] = 0;         /* in case the password was exactly 8 chars long */
 #endif
     ka_StringToKey(npasswd, realm, &newkey);
-    des_string_to_key(npasswd, ktc_to_cblockptr(&newmitkey));
+    DES_string_to_key(npasswd, ktc_to_cblockptr(&newmitkey));
     memset(npasswd, 0, sizeof(npasswd));
 
     if (lexplicit)
index e66af2120b8d6f1830e06b598918e4b48541dd34..5685b1b6478f255627b2a431a5cbb8947d40f8c9 100644 (file)
 
 #include <roken.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#endif
+
 #include <afs/stds.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <string.h>
 #include <afs/afsutil.h>
 #include <time.h>
+
+#define HC_DEPRECATED
+#include <hcrypto/des.h>
+
 #include <afs/com_err.h>
 #include <lwp.h>
-#include <des.h>
-#include <des_prototypes.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
 #include <afs/auth.h>
 #include <ubik.h>
 
+
 #include "kauth.h"
 #include "kautils.h"
 #include "kauth_internal.h"
@@ -131,7 +138,7 @@ create_cipher(char *cipher, int *cipherLen,
     int slen;
     unsigned char life = time_to_life(start, end);
     int len;
-    des_key_schedule schedule;
+    DES_key_schedule schedule;
     afs_int32 code;
 
     answer = cipher;
@@ -164,9 +171,9 @@ create_cipher(char *cipher, int *cipherLen,
        printf("\n");
     }
 
-    if ((code = des_key_sched(ktc_to_cblock(key), schedule)))
+    if ((code = DES_key_sched(ktc_to_cblock(key), &schedule)))
        printf("In KAAuthenticate: key_sched returned %d\n", code);
-    des_pcbc_encrypt(cipher, cipher, len, schedule, ktc_to_cblockptr(key), ENCRYPT);
+    DES_pcbc_encrypt(cipher, cipher, len, &schedule, ktc_to_cblockptr(key), ENCRYPT);
     *cipherLen = round_up_to_ebs(len);
 
     if (krb_udp_debug) {
@@ -218,13 +225,13 @@ check_auth(struct packet *pkt, char *auth, int authLen,
           char *cell)
 {
     char *packet;
-    des_key_schedule schedule;
+    DES_key_schedule schedule;
     afs_int32 cksum;
     afs_int32 time_sec;
     int byteOrder = pkt->byteOrder;
 
-    des_key_sched(ktc_to_cblock(key), schedule);
-    des_pcbc_encrypt(auth, auth, authLen, schedule, ktc_to_cblockptr(key), DECRYPT);
+    DES_key_sched(ktc_to_cblock(key), &schedule);
+    DES_pcbc_encrypt(auth, auth, authLen, &schedule, ktc_to_cblockptr(key), DECRYPT);
     packet = auth;
     if (strcmp(packet, name) != 0)
        return KABADTICKET;
@@ -324,7 +331,7 @@ UDP_Authenticate(int ksoc, struct sockaddr_in *client, char *name,
        }
 
        /* make the ticket */
-       code = des_random_key(ktc_to_cblock(&sessionKey));
+       code = DES_new_random_key(ktc_to_cblock(&sessionKey));
        if (code) {
            code = KERB_ERR_NULL_KEY;   /* was KANOKEYS */
            goto abort;
@@ -537,7 +544,7 @@ UDP_GetTicket(int ksoc, struct packet *pkt, afs_int32 kvno,
     if (ntohl(server.flags) & KAFNOSEAL)
        return KABADSERVER;
 
-    code = des_random_key(ktc_to_cblock(&sessionKey));
+    code = DES_new_random_key(ktc_to_cblock(&sessionKey));
     if (code) {
        code = KERB_ERR_NULL_KEY;       /* was KANOKEYS */
        goto fail;
@@ -1035,7 +1042,7 @@ FindBlock(at, aname, ainstance, tentry)
     strcpy(tentry->userID.name, aname);
     strcpy(tentry->userID.instance, ainstance);
     tentry->key_version = htonl(17);
-    des_string_to_key("toa", &tentry->key);
+    DES_string_to_key("toa", &tentry->key);
     tentry->flags = htonl(KAFNORMAL);
     tentry->user_expiration = htonl(NEVERDATE);
     tentry->max_ticket_lifetime = htonl(MAXKTCTICKETLIFETIME);
@@ -1052,7 +1059,7 @@ ka_LookupKey(tt, name, inst, kvno, key)
 {
     printf("Calling ka_LookupKey with '%s'.'%s'\n", name, inst);
     *kvno = 23;
-    des_string_to_key("applexx", key);
+    DES_string_to_key("applexx", key);
 }
 
 static afs_int32
@@ -1065,7 +1072,7 @@ kvno_tgs_key(authDomain, kvno, tgskey)
        printf("Called with wrong %s as authDomain\n", authDomain);
     if (kvno != 23)
        printf("kvno_tgs_key: being called with wrong kvno: %d\n", kvno);
-    des_string_to_key("applexx", tgskey);
+    DES_string_to_key("applexx", tgskey);
     return 0;
 }
 
index b62e049c748efb4d4e981ba54471036928b8a925..a2b7281510ef4f9d842395fc20357580bf7f4f01 100644 (file)
@@ -9,10 +9,6 @@
  * Include file with authentication protocol information.
  */
 
-#include <mit-cpyright.h>
-
-                                                                                                                                       /* #include <krb_conf.h> *//* removed 890221 */
-
 #ifndef PROT_DEFS
 #define PROT_DEFS
 
diff --git a/src/kauth/read_passwd.c b/src/kauth/read_passwd.c
deleted file mode 100644 (file)
index b30101b..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * This routine prints the supplied string to standard
- * output as a prompt, and reads a password string without
- * echoing.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#include <mit-cpyright.h>
-
-#include <stdio.h>
-#include <des.h>
-#include <des_prototypes.h>
-#ifdef BSDUNIX
-#include <strings.h>
-#include <sys/ioctl.h>
-#include <signal.h>
-#include <setjmp.h>
-#else
-#include <string.h>
-#endif
-#if defined(AFS_AIX_ENV)
-#include <signal.h>
-#endif
-#if defined(AFS_SGI_ENV)
-#include <signal.h>
-#endif
-#include <string.h>
-
-#if    defined (AFS_AIX_ENV) || defined(AFS_SGI_ENV)
-/* Just temp till we figure out the aix stuff */
-#undef BSDUNIX
-static int intrupt;
-#endif
-
-#ifdef BSDUNIX
-static jmp_buf env;
-#endif
-
-#ifdef BSDUNIX
-static void sig_restore();
-static push_signals(), pop_signals();
-int read_pw_string();
-#endif
-
-/*** Routines ****************************************************** */
-int
-des_read_password(C_Block *k, char *prompt, int verify)
-{
-    int ok;
-    char key_string[BUFSIZ];
-
-#ifdef BSDUNIX
-    if (setjmp(env)) {
-       ok = -1;
-       goto lose;
-    }
-#endif
-
-    ok = read_pw_string(key_string, BUFSIZ, prompt, verify);
-    if (ok == 0)
-       string_to_key(key_string, k);
-#ifdef BSDUNIX
-  lose:
-#endif
-    memset(key_string, 0, sizeof(key_string));
-    return ok;
-}
-
-/* good_gets is like gets except that it take a max string length and won't
-   write past the end of its input buffer.  It returns a variety of negative
-   numbers in case of errors and zero if there was no characters read (a blank
-   line for instance).  Otherwise it returns the length of the string read in.
-   */
-
-static int
-good_gets(char *s, int max)
-{
-    int l;                     /* length of string read */
-    if (!fgets(s, max, stdin)) {
-       if (feof(stdin))
-           return EOF;         /* EOF on input, nothing read */
-       else
-           return -2;          /* I don't think this can happen */
-    }
-    l = strlen(s);
-    if (l && (s[l - 1] == '\n'))
-       s[--l] = 0;
-    return l;
-}
-
-/*
- * This version just returns the string, doesn't map to key.
- *
- * Returns 0 on success, non-zero on failure.
- */
-
-#if    !defined(BSDUNIX) && (defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV))
-#include <termio.h>
-#endif
-
-int
-read_pw_string(char *s, int max, char *prompt, int verify)
-{
-    int ok = 0;
-
-#ifdef BSDUNIX
-    jmp_buf old_env;
-    struct sgttyb tty_state;
-#else
-#if    defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
-    struct termio ttyb;
-    FILE *fi;
-    char savel, flags;
-    int (*sig) (), catch();
-    extern void setbuf();
-    extern int kill(), fclose();
-#endif
-#endif
-    char key_string[BUFSIZ];
-
-    if (max > BUFSIZ) {
-       return -1;
-    }
-#ifdef BSDUNIX
-    memcpy(old_env, env, sizeof(env));
-    if (setjmp(env))
-       goto lose;
-
-    /* save terminal state */
-    if (ioctl(0, TIOCGETP, &tty_state) == -1)
-       return -1;
-
-    push_signals();
-    /* Turn off echo */
-    tty_state.sg_flags &= ~ECHO;
-    if (ioctl(0, TIOCSETP, &tty_state) == -1) {
-       pop_signals();
-       return -1;
-    }
-#else
-#if    defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
-    if ((fi = fopen("/dev/tty", "r+")) == NULL)
-       return (-1);
-    else
-       setbuf(fi, (char *)NULL);
-    sig = signal(SIGINT, catch);
-    intrupt = 0;
-    (void)ioctl(fileno(fi), TCGETA, &ttyb);
-    savel = ttyb.c_line;
-    ttyb.c_line = 0;
-    flags = ttyb.c_lflag;
-    ttyb.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
-    (void)ioctl(fileno(fi), TCSETAF, &ttyb);
-#endif
-#endif
-
-    while (!ok) {
-       printf("%s", prompt);
-       fflush(stdout);
-#ifdef CROSSMSDOS
-       h19line(s, sizeof(s), 0);
-       if (!strlen(s))
-           continue;
-#else
-       if (good_gets(s, max) <= 0) {
-           if (feof(stdin))
-               break;          /* just give up */
-           else
-               continue;       /* try again: blank line */
-       }
-#endif
-       if (verify) {
-           printf("\nVerifying, please re-enter %s", prompt);
-           fflush(stdout);
-#ifdef CROSSMSDOS
-           h19line(key_string, sizeof(key_string), 0);
-           if (!strlen(key_string))
-               continue;
-#else
-           if (good_gets(key_string, sizeof(key_string)) <= 0)
-               continue;
-#endif
-           if (strcmp(s, key_string)) {
-               printf("\n\07\07Mismatch - try again\n");
-               fflush(stdout);
-               continue;
-           }
-       }
-       ok = 1;
-    }
-
-#ifdef BSDUNIX
-  lose:
-#endif
-    if (!ok)
-       memset(s, 0, max);
-#ifdef BSDUNIX
-    /* turn echo back on */
-    tty_state.sg_flags |= ECHO;
-    if (ioctl(0, TIOCSETP, &tty_state))
-       ok = 0;
-    pop_signals();
-    memcpy(env, old_env, sizeof(env));
-#else
-#if    defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
-    ttyb.c_lflag = flags;
-    ttyb.c_line = savel;
-    (void)ioctl(fileno(fi), TCSETAW, &ttyb);
-    (void)signal(SIGINT, sig);
-    if (fi != stdin)
-       (void)fclose(fi);
-    if (intrupt)
-       (void)kill(getpid(), SIGINT);
-#endif
-#endif
-    if (verify)
-       memset(key_string, 0, sizeof(key_string));
-    s[max - 1] = 0;            /* force termination */
-    return !ok;                        /* return nonzero if not okay */
-}
-
-#ifdef BSDUNIX
-/*
- * this can be static since we should never have more than
- * one set saved....
- */
-static int (*old_sigfunc[NSIG]) (int);
-
-static
-push_signals(void)
-{
-    int i;
-    for (i = 0; i < NSIG; i++)
-       old_sigfunc[i] = signal(i, sig_restore);
-}
-
-static
-pop_signals(void)
-{
-    int i;
-    for (i = 0; i < NSIG; i++)
-       signal(i, old_sigfunc[i]);
-}
-
-static void
-sig_restore(int sig, int code, struct sigcontext *scp)
-{
-    longjmp(env, 1);
-}
-#endif
-
-#if    defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
-static int
-catch(void)
-{
-    ++intrupt;
-}
-#endif
index 28af5ff300c545387bc8fc19727e423c20a99ff7..eed9d7455f777569440e39b8fb2fd40f357c8214 100644 (file)
@@ -28,8 +28,7 @@
 #include <time.h>
 #include <ubik.h>
 #include <afs/cmd.h>
-#include <des.h>
-#include <des_prototypes.h>
+#include <hcrypto/des.h>
 #include <rx/rxkad.h>
 
 #include <afs/com_err.h>
@@ -471,8 +470,8 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
                    printf("Entry %d has zero length name\n", i);
                continue;
            }
-           if (!des_check_key_parity(ktc_to_cblock(&entry.key))
-               || des_is_weak_key(ktc_to_cblock(&entry.key))) {
+           if (!DES_check_key_parity(ktc_to_cblock(&entry.key))
+               || DES_is_weak_key(ktc_to_cblock(&entry.key))) {
                fprintf(stderr, "Entry %d, %s, has bad key\n", i,
                        EntryName(&entry));
                continue;
index b9a45bf463f04cbf44730dbe053168a4d2124055..0fe5c66b376dd24add6f829848fbeb549076a1cc 100644 (file)
@@ -11,7 +11,6 @@ RELDIR=kauth\test
 
 EXELIBS = \
        $(DESTDIR)\afslwp.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
        $(DESTDIR)\afs\afsauth.lib \
        $(DESTDIR)\afs\afscmd.lib \
index e9b32e6c86d878a9fba6bac7563c9fbb90409cc5..28220528e850c77ba7df7419106c865f5ccbc804 100644 (file)
 #include <afs/sys_prototypes.h>
 #endif
 
-#include <des.h>
-#include <des_prototypes.h>
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
 #include <rx/rxkad.h>          /* max ticket lifetime */
+#include <hcrypto/des.h>
+#include <hcrypto/ui.h>
+
 #include "kauth.h"
 #include "kautils.h"
 #include <afs/ktc.h>
 
-
 afs_int32
 GetTickets(char *name, char *instance, char *realm,
           struct ktc_encryptionKey * key, Date lifetime,
@@ -187,7 +187,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
     if (flags & KA_USERAUTH_ONLY_VERIFY) {
        code = ka_VerifyUserToken(name, instance, realm, &key);
        if (code == KABADREQUEST) {
-           des_string_to_key(password, ktc_to_cblockptr(&key));
+           DES_string_to_key(password, ktc_to_cblockptr(&key));
            code = ka_VerifyUserToken(name, instance, realm, &key);
        }
     } else {
@@ -212,7 +212,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
            GetTickets(name, instance, realm, &key, lifetime,
                       password_expires, dosetpag);
        if (code == KABADREQUEST) {
-           des_string_to_key(password, ktc_to_cblockptr(&key));
+           DES_string_to_key(password, ktc_to_cblockptr(&key));
            code =
                GetTickets(name, instance, realm, &key, lifetime,
                           password_expires, dosetpag);
@@ -264,7 +264,7 @@ ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP)
     code = ka_Init(0);
     if (code)
        return code;
-    code = read_pw_string(password, plen, prompt, 0);
+    code = UI_UTIL_read_pw_string(password, plen, prompt, 0);
     if (code)
        code = KAREADPW;
     else if (strlen(password) == 0)
index 6f5a3fcf117bbfc1b6a472b25ac64e0fec23daf6..e471474bc497c43aec9dd22242ab05bc5b886734 100644 (file)
@@ -27,7 +27,7 @@
 #include <afs/krb_prot.h>
 #include <rx/rxkad.h>
 #include <crypt.h>
-#include <des.h>
+#include <hcrypto/des.h>
 
 int krb_add_host(struct sockaddr_in *server_list_p);
 static void krb_set_port(long port);
@@ -124,7 +124,7 @@ ka_UserAuthenticateGeneral2(afs_int32 flags, char *name, char *instance,
 
     /* encrypt password, both ways */
     ka_StringToKey(password, upperRealm, &key1);
-    des_string_to_key(password, &key2);
+    DES_string_to_key(password, &key2);
 
     /* set port number */
     sp = getservbyname("kerberos", "udp");
@@ -207,7 +207,6 @@ static int krbONE = 1;
 #include <string.h>
 #include <time.h>
 
-#include <des.h>
 #include "krb.h"
 
 #include <sys/types.h>
@@ -299,7 +298,7 @@ static
 check_response(KTEXT rpkt, KTEXT cip, char *service, char *instance,
               char *realm, struct ktc_encryptionKey *key)
 {
-    Key_schedule key_s;
+    DES_key_schedule key_s;
     char *ptr;
     char s_service[SNAME_SZ];
     char s_instance[INST_SZ];
@@ -314,9 +313,9 @@ check_response(KTEXT rpkt, KTEXT cip, char *service, char *instance,
     memcpy((char *)(cip->dat), (char *)pkt_cipher(rpkt), cip->length);
 
     /* decrypt ticket */
-    key_sched((char *)key, key_s);
-    pcbc_encrypt((C_Block *) cip->dat, (C_Block *) cip->dat,
-                (long)cip->length, key_s, (des_cblock *) key, 0);
+    DES_key_sched((DES_cblock *)key, &key_s);
+    DES_pcbc_encrypt((DES_cblock *) cip->dat, (DES_cblock *) cip->dat,
+                    (long)cip->length, &key_s, (DES_cblock *) key, 0);
 
     /* Skip session key */
     ptr = (char *)cip->dat + 8;
@@ -428,7 +427,7 @@ krb_get_in_tkt_ext(user, instance, realm, service, sinstance, life, key1,
     KTEXT cip = &cip_st;       /* Returned Ciphertext */
     KTEXT_ST tkt_st;
     KTEXT tkt = &tkt_st;       /* Current ticket */
-    C_Block ses;               /* Session key for tkt */
+    DES_cblock ses;            /* Session key for tkt */
     int kvno;                  /* Kvno for session key */
     unsigned char *v = pkt->dat;       /* Prot vers no */
     unsigned char *t = (pkt->dat + 1); /* Prot msg type */
@@ -937,7 +936,7 @@ Andrew_StringToKey(str, cell, key)
            keybytes[i] = (unsigned char)(temp << 1);
        }
     }
-    des_fixup_key_parity((unsigned char *)key);
+    DES_fixup_key_parity((DES_cblock *)key);
 }
 
 
@@ -947,7 +946,7 @@ StringToKey(str, cell, key)
      char *cell;               /* cell for password */
      struct ktc_encryptionKey *key;
 {
-    des_key_schedule schedule;
+    DES_key_schedule schedule;
     char temp_key[8];
     char ivec[8];
     char password[BUFSIZ];
@@ -961,14 +960,14 @@ StringToKey(str, cell, key)
 
     memcpy(ivec, "kerberos", 8);
     memcpy(temp_key, "kerberos", 8);
-    des_fixup_key_parity(temp_key);
-    des_key_sched(temp_key, schedule);
-    des_cbc_cksum(password, ivec, passlen, schedule, ivec);
+    DES_fixup_key_parity(temp_key);
+    DES_key_sched(temp_key, &schedule);
+    DES_cbc_cksum(password, ivec, passlen, &schedule, ivec);
 
     memcpy(temp_key, ivec, 8);
-    des_fixup_key_parity(temp_key);
-    des_key_sched(temp_key, schedule);
-    des_cbc_cksum(password, (char *)key, passlen, schedule, ivec);
+    DES_fixup_key_parity(temp_key);
+    DES_key_sched(temp_key, &schedule);
+    DES_cbc_cksum(password, (DES_cblock *)key, passlen, &schedule, ivec);
 
-    des_fixup_key_parity((char *)key);
+    DES_fixup_key_parity((DES_cblock *)key);
 }
index f1fd8697b3e63671ac869e912698efd47fd39cfe..d336219ecd8f88c781f3efe37284db120cd4696d 100644 (file)
@@ -44,72 +44,94 @@ SAMPLELIBS =\
        ${TOP_LIBDIR}/libbosadmin.a \
        ${TOP_LIBDIR}/libafsauthent.a \
        ${TOP_LIBDIR}/libafsrpc.a \
-       $(TOP_LIBDIR)/libafsutil.a
+       $(TOP_LIBDIR)/libafsutil.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 all test tests: $(SAMPLEPROGS)
 
 cm_client_config: cm_client_config.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 cm_list_cells: cm_list_cells.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 cm_local_cell: cm_local_cell.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 cm_server_prefs: cm_server_prefs.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxdebug_basic_stats: rxdebug_basic_stats.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxdebug_conns: rxdebug_conns.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxdebug_peers: rxdebug_peers.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxdebug_rx_stats: rxdebug_rx_stats.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxdebug_supported_stats: rxdebug_supported_stats.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxdebug_version: rxdebug_version.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_clear_peer: rxstat_clear_peer.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_clear_process: rxstat_clear_process.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_disable_peer: rxstat_disable_peer.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_disable_process: rxstat_disable_process.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_enable_peer: rxstat_enable_peer.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_enable_process: rxstat_enable_process.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_get_peer: rxstat_get_peer.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_get_process: rxstat_get_process.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_get_version: rxstat_get_version.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_query_peer: rxstat_query_peer.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 rxstat_query_process: rxstat_query_process.o $(SAMPLELIBS)
-       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(MT_LIBS) $(XLIBS)
+       $(AFS_LDRULE) $@.o $(SAMPLELIBS) $(LIB_roken) $(LIB_crypt) \
+               $(MT_LIBS) $(XLIBS)
 
 #
 # Errors
index e5d193ed1b55f18b216edd0f22708cd685760bb7..0d05bb12dc6ab017cf9cff40335286ce975da761 100644 (file)
@@ -27,7 +27,8 @@ AFSCPLIBS =\
        $(TOP_LIBDIR)/libafsauthent.a \
        $(TOP_LIBDIR)/libafsrpc.a \
        $(TOP_LIBDIR)/libcmd.a \
-       $(TOP_LIBDIR)/libafsutil.a
+       $(TOP_LIBDIR)/libafsutil.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 AFSCPOBJS =\
        bos.o \
@@ -43,7 +44,7 @@ CFLAGS_client.o = @CFLAGS_NOERROR@
 
 afscp: afscp.o $(AFSCPOBJS) $(AFSCPLIBS)
        $(AFS_LDRULE) afscp.o $(AFSCPOBJS) $(AFSCPLIBS) \
-               $(LIB_roken) ${MT_LIBS} $(XLIBS)
+               $(LIB_roken) $(LIB_crypt) ${MT_LIBS} $(XLIBS)
 
 #######################################################################
 install:
index 7a048a947866cb757b467444a99b8c2912e78ee7..31320641a5f9a9a2ed9c3ea9f0a5102b52ff5ca4 100644 (file)
@@ -48,8 +48,7 @@ KAUTHOBJS = \
        kautils.o \
        kalocalcell.o \
        kaerrors.o \
-       user.o \
-       read_passwd.o
+       user.o
 
 UBIKOBJS = \
        uinit.o \
index 36359c248198d2708e5f74e2a64d1d6c73490070..acc39c327c386ca0adffe7a3847c08087424a499 100644 (file)
@@ -50,6 +50,7 @@ KAUTHOBJS = \
        $(OUT)\kauth.cs.obj \
        $(OUT)\kaaux.obj \
        $(OUT)\client.obj \
+       $(OUT)\crypt.obj \
        $(OUT)\authclient.obj \
        $(OUT)\kautils.obj \
        $(OUT)\kalocalcell.obj \
@@ -138,7 +139,6 @@ DLLLIBS =\
        $(DESTDIR)\lib\afspthread.lib \
 !ENDIF
        $(DESTDIR)\lib\afsrpc.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
@@ -146,6 +146,7 @@ DLLLIBS =\
         $(DESTDIR)\lib\afslwp.lib \
         $(DESTDIR)\lib\lanahelper.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(LIBFILE): $(DLLOBJS) $(DLLLIBS) $(RXOBJS)
index 1e1a1088d17a882cf548c052e7ff3eebed784f2c..8158d9cf7f9777a602aaeb2d9797fa8f224b9f7d 100644 (file)
@@ -27,7 +27,6 @@ RX = ${srcdir}/../rx
 RXKAD = ${srcdir}/../rxkad
 RXSTAT = ${srcdir}/../rxstat
 FSINT = ${srcdir}/../fsint
-DES = ${srcdir}/../des
 COMERR = ${srcdir}/../comerr
 UTIL = ${srcdir}/../util
 SYS = ${srcdir}/../sys
@@ -98,41 +97,20 @@ RXKADOBJS =\
        ticket.o \
        ticket5.o \
        crc.o \
-       md4.o \
-       md5.o \
        fcrypt.o \
        crypt_conn.o
 
-DESOBJS =\
-       des.o \
-       cbc_encrypt.o \
-       pcbc_encrypt.o \
-       cksum.o \
-       new_rnd_key.o \
-       key_sched.o \
-       debug_decl.o \
-       quad_cksum.o \
-       key_parity.o \
-       weak_key.o \
-       strng_to_key.o \
-       misc.o \
-       util.o
-
-CRYPT_OBJ = crypt.o
-
 LWPOBJS = \
        fasttime.o \
        lock.o
 
 LIBOBJS = \
        ${RXOBJS} \
-       ${DESOBJS} \
        ${XDROBJS} \
        ${RXKADOBJS} \
        ${COMERROBJS} \
        ${UTILOBJS} \
        ${SYSOBJS} \
-       ${CRYPT_OBJ} \
        ${RXSTATOBJS} \
        ${LWPOBJS} \
        ${FSINTOBJS}
@@ -275,84 +253,6 @@ xdr_update.o: ${RX}/xdr_update.c
 xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
        $(AFS_CCRULE) $(RX)/xdr_afsuuid.c
 
-# Note that the special case statement for compiling des.c is present
-# simply to work around a compiler bug on HP-UX 11.0.  The symptom of
-# the problem is that linking the pthread fileserver fails with messages
-# such as
-#
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[411] out of synch
-#   Please contact your HP Support representative
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[442] out of synch
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[450] out of synch
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[529] out of synch
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[544] out of synch
-#   ...
-#   pxdb32: internal error. File won't be debuggable (still a valid executable)
-#   *** Error exit code 10
-#
-# The problematic version of pxdb is:
-#
-#   $ what /opt/langtools/bin/pxdb32
-#   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision$
-#
-# The problem occurs when -g and -O are both used when compiling des.c.
-# The simplest way to work around the problem is to leave out either -g or -O.
-# Since des.c is relatively stable I've chosen to eliminate -g rather
-# than take any hit in performance.
-
-des.o: ${DES}/des.c
-       set -x; \
-       case ${SYS_NAME} in \
-       hp_ux11*) \
-               set X `echo ${AFS_CCRULE} -I../des ${DES}/des.c | sed s/-g//`; shift; \
-               "$$@" \
-               ;; \
-       *) \
-               ${AFS_CCRULE} -I../des ${DES}/des.c \
-               ;; \
-       esac
-
-crypt.o: ${DES}/crypt.c
-       $(AFS_CCRULE) $(DES)/crypt.c
-
-cbc_encrypt.o: ${DES}/cbc_encrypt.c
-       $(AFS_CCRULE) $(DES)/cbc_encrypt.c
-
-pcbc_encrypt.o: ${DES}/pcbc_encrypt.c
-       $(AFS_CCRULE) $(DES)/pcbc_encrypt.c
-
-cksum.o: ${DES}/cksum.c
-       $(AFS_CCRULE) $(DES)/cksum.c
-
-new_rnd_key.o: ${DES}/new_rnd_key.c
-       $(AFS_CCRULE) $(DES)/new_rnd_key.c
-
-key_sched.o: ${DES}/key_sched.c
-       $(AFS_CCRULE) -I../des $(DES)/key_sched.c
-
-debug_decl.o: ${DES}/debug_decl.c
-       $(AFS_CCRULE) $(DES)/debug_decl.c
-
-quad_cksum.o: ${DES}/quad_cksum.c
-       $(AFS_CCRULE) $(DES)/quad_cksum.c
-
-key_parity.o: ${DES}/key_parity.c
-       $(AFS_CCRULE) -I../des $(DES)/key_parity.c
-
-weak_key.o: ${DES}/weak_key.c
-       $(AFS_CCRULE) $(DES)/weak_key.c
-
-strng_to_key.o: ${DES}/strng_to_key.c
-       $(AFS_CCRULE) $(DES)/strng_to_key.c
-
-misc.o: ${DES}/misc.c
-       $(AFS_CCRULE) $(DES)/misc.c
-
-util.o: ${DES}/util.c
-       $(AFS_CCRULE) $(DES)/util.c
-
-
 error_msg.o: ${COMERR}/error_msg.c
        $(AFS_CCRULE) $(COMERR)/error_msg.c
 
index 4fbf958136502bdcfff7bcd05c8b0701b1eee505..74f2657f93acf69c411b6034351e373e468c1dba 100644 (file)
@@ -13,7 +13,6 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DNOGDI -DWIN32_LEAN_AND_MEAN -DAFS_P
 RX = ..\rx
 RXSTAT = ..\rxstat
 RXKAD = ..\rxkad
-DES = ..\des
 UTIL = ..\util
 FSINT = ..\fsint
 COMERR = ..\comerr
@@ -43,16 +42,10 @@ RXOBJS = $(OUT)\rx_event.obj $(OUT)\rx_user.obj $(OUT)\rx_pthread.obj \
 RXSTATBJS = $(OUT)\rxstat.obj $(OUT)\rxstat.ss.obj $(OUT)\rxstat.xdr.obj $(OUT)\rxstat.cs.obj
 
 LIBRXKAD_OBJS = $(OUT)\rxkad_client.obj $(OUT)\rxkad_server.obj $(OUT)\rxkad_common.obj $(OUT)\ticket.obj \
-       $(OUT)\ticket5.obj $(OUT)\crc.obj $(OUT)\md4.obj $(OUT)\md5.obj $(OUT)\AFS_component_version_number.obj
+       $(OUT)\ticket5.obj $(OUT)\crc.obj $(OUT)\AFS_component_version_number.obj
 
 LIBRXKAD_REGOBJS = $(OUT)\bg-fcrypt.obj
 
-DESOBJS_INT = $(OUT)\des.obj $(OUT)\cbc_encrypt.obj $(OUT)\pcbc_encrypt.obj $(OUT)\cksum.obj $(OUT)\new_rnd_key.obj \
-       $(OUT)\key_sched.obj $(OUT)\debug_decl.obj $(OUT)\quad_cksum.obj $(OUT)\key_parity.obj \
-       $(OUT)\weak_key.obj $(OUT)\strng_to_key.obj $(OUT)\util.obj
-
-DESOBJS = $(DESOBJS_INT) $(OUT)\misc.obj 
-
 UTILOBJS = $(OUT)\casestrcpy.obj $(OUT)\winsock_nt.obj
 
 COMERRBJS = $(OUT)\error_msg.obj $(OUT)\et_name.obj $(OUT)\com_err.obj
@@ -63,7 +56,7 @@ FSINTBJS = $(OUT)\afsint.cs.obj $(OUT)\afsint.xdr.obj $(OUT)\afscbint.cs.obj $(O
        $(OUT)\afsaux.obj
 
 DLLOBJS = $(MULTIOBJS) $(RXOBJS) $(XDROBJS) $(RXSTATBJS) $(LIBRXKAD_OBJS) \
-       $(DESOBJS) $(LIBRXKAD_REGOBJS) $(UTILBJS) $(COMERRBJS) \
+       $(LIBRXKAD_REGOBJS) $(UTILBJS) $(COMERRBJS) \
        $(FSINTBJS) $(LWPOBJS) $(OUT)\afsrpc.res
 
 $(MULTIOBJS) $(RXOBJS) $(XDROBJS):$(RX)\$$(@B).c
@@ -75,12 +68,6 @@ $(RXSTATBJS):$(RXSTAT)\$$(@B).c
 $(LIBRXKAD_REGOBJS) $(LIBRXKAD_OBJS):$(RXKAD)\$$(@B).c
        $(C2OBJ) $** -I$(RXKAD)
 
-$(DESOBJS_INT):$(DES)\$$(@B).c
-       $(C2OBJ) $** -I$(DES)
-
-$(OUT)\misc.obj:$(DES)\misc.c
-       $(C2OBJ) $** -DDONT_INCL_MAIN -I$(DES)
-
 $(COMERRBJS):$(COMERR)\$$(@B).c
        $(C2OBJ) $** -I$(COMERR)
 
@@ -104,6 +91,7 @@ DLLLIBS =\
 !ENDIF
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(LIBFILE): $(DLLOBJS) $(DLLLIBS)
@@ -117,31 +105,10 @@ $(LIBFILE): $(DLLOBJS) $(DLLLIBS)
 # Definitions for generating versioninfo resources
 $(OUT)\afsrpc.res: AFS_component_version_number.h
 
-install:
-!       IF (EXIST(..\..\src\des\NTMakefile))
-               $(NTMAKE) $(LIBFILE)
-!      else
-               $(NTMAKE) libstub
-!      endif
+install: $(LIBFILE)
 
 install9x: install
 
-!IF (EXIST(..\..\src\des\NTMakefile))
-!ELSE IF (EXIST(..\..\DESLIB))
-DESPAR = ..\..\DESLIB\dest
-!ELSE IF (EXIST(..\..\..\DESLIB))
-DESPAR = ..\..\..\DESLIB\dest
-!ELSE
-!ERROR Must create DESLIB link in the same directory as PARENT link.
-!ENDIF
-
-libstub:
-       $(COPY) $(DESPAR)\lib\afsrpc.dll \
-               $(DESTDIR)\lib\afsrpc.dll
-       $(COPY) $(DESPAR)\lib\afsrpc.lib \
-               $(DESTDIR)\lib\afsrpc.lib
-       $(COPY) $(DESPAR)\lib\afsrpc.exp \
-               $(DESTDIR)\lib\afsrpc.exp
 
 clean::
        $(DEL) $(DESTDIR)\lib\afsrpc.dll $(DESTDIR)\lib\afsrpc.lib $(DESTDIR)\lib\afsrpc.exp
index 048fb1e2c7a1f369e411af45bf41a6d99a51cb6a..0fc8b243f8fcd11d47153505ca3f7624f91d79bd 100755 (executable)
@@ -1,11 +1,4 @@
 EXPORTS
-       des_check_key_parity                    @2
-       des_fixup_key_parity                    @5
-       des_init_random_number_generator        @6
-       des_is_weak_key                         @7
-       des_key_sched                           @8
-       des_random_key                          @9
-       des_string_to_key                       @10
        ktohl                                   @11
        life_to_time                            @12
        rx_DestroyConnection                    @13
index 3e48f587452417cbbafac73702b4dd6d261c4fe5..e91128c842c841d83139a3ebceed9a33369fd607 100644 (file)
@@ -16,7 +16,6 @@ WEBOBJ=../AFSWEB
 AFS    =../afs
 RX     =../rx
 AFSINT=../afsint
-DES    =../des
 LIB    =../lib
 NS_INCL =SRC/../afsweb/netscape_includes
 
@@ -75,12 +74,13 @@ webinstall: all \
        ${TOP_LIBDIR}/$(LIBAFSWEB) \
        ${TOP_LIBDIR}/$(LIBAFSWEBKRB) 
 
-linktest: UAFS/$(LIBUAFS) ${TOP_OBJDIR}/lib/libdes.a
-       $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) $(LDFLAGS_roken) -o linktest \
+linktest: UAFS/$(LIBUAFS)
+       $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) \
+               $(LDFLAGS_roken) $(LDFLAGS_hcrypto) -o linktest \
                ${srcdir}/linktest.c $(COMMON_INCLUDE) -DUKERNEL \
                UAFS/$(LIBUAFS) ${TOP_LIBDIR}/libcmd.a \
-               ${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/libafsutil.a \
-               $(LIB_roken) $(TEST_LIBS) $(XLIBS)
+               ${TOP_LIBDIR}/libafsutil.a \
+               $(LIB_hcrypto) $(LIB_roken) $(TEST_LIBS) $(XLIBS)
 
 CRULE1=        $(CC) $(COMMON_INCLUDE) $(OPTF) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
 CRULE2=        $(CC) $(COMMON_INCLUDE) $(OPTF) $(WEBOPTS) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
@@ -1522,8 +1522,8 @@ $(JUAFS)/xdr_len.o: $(TOP_SRC_RX)/xdr_len.c
        $(CRULE1)
 
 clean:
-       -$(RM) -rf UAFS* JUAFS* AFSWEB* nsapi des afs afsint config rx
-       -$(RM) -f  h net netinet rpc ufs machine inet nfs sys des linktest $(AFS_OS_CLEAN)
+       -$(RM) -rf UAFS* JUAFS* AFSWEB* nsapi afs afsint config rx
+       -$(RM) -f  h net netinet rpc ufs machine inet nfs sys linktest $(AFS_OS_CLEAN)
 
 
 install: UAFS/$(LIBUAFS) JUAFS/$(LIBJUAFS)
@@ -1536,7 +1536,7 @@ dest: $(TOP_INCDIR)/afs/param.h $(TOP_INCDIR)/afs/stds.h \
                $(TOP_INCDIR)/afs/afs_stats.h \
                $(TOP_SRCDIR)/afs/sysincludes.h \
                $(TOP_SRCDIR)/afs/UKERNEL/afs_usrops.h \
-               ${TOP_OBJDIR}/lib/libdes.a UAFS/$(LIBUAFS) JUAFS/$(LIBJUAFS)
+               UAFS/$(LIBUAFS) JUAFS/$(LIBJUAFS)
        ${INSTALL} -d ${DEST}/root.perf/include/afs
        ${INSTALL} -d ${DEST}/root.perf/lib
        ${INSTALL_DATA} $(TOP_INCDIR)/afs/param.h \
@@ -1551,8 +1551,6 @@ dest: $(TOP_INCDIR)/afs/param.h $(TOP_INCDIR)/afs/stds.h \
                ${DEST}/root.perf/include/afs/sysincludes.h
        ${INSTALL_DATA} $(TOP_SRCDIR)/afs/UKERNEL/afs_usrops.h \
                ${DEST}/root.perf/include/afs/afs_usrops.h
-       ${INSTALL_DATA} ${TOP_OBJDIR}/lib/libdes.a \
-               ${DEST}/root.perf/lib/libdes.a
        ${INSTALL_DATA} UAFS/$(LIBUAFS) ${DEST}/root.perf/lib/$(LIBUAFS)
        ${INSTALL_DATA} JUAFS/$(LIBJUAFS) ${DEST}/root.perf/lib/$(LIBJUAFS)
 
index fe14f9ae1a31bfb03cd424393bc9db0e58ed1963..37d896e19a893d129aa646dc08749636e9c7a622 100644 (file)
@@ -33,7 +33,7 @@ OPTF=-O
 
 TEST_CFLAGS=-pthread -D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_LINUX22_ENV
 TEST_LDFLAGS=
-TEST_LIBS=-lpthread
+TEST_LIBS=-lpthread @LIB_crypt@
 
 LIBUAFS = libuafs.a
 LIBJUAFS = libjuafs.a
index 30c93fd1be03bb91120564bffd8d382b67bd0bec..e3fd6bd68dab933156802c710ffe38cf3904e63f 100644 (file)
@@ -22,17 +22,17 @@ ${TOP_INCDIR}/afs/cellconfig.h
 
 LIBRARIES=${TOP_LIBDIR}/libauth.a \
                ${TOP_LIBDIR}/librxkad.a \
-               ${TOP_LIBDIR}/libdes.a \
                ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a \
                ${TOP_LIBDIR}/libsys.a \
                ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
+               ${TOP_LIBDIR}/libafshcrypto_lwp.a \
                ${TOP_LIBDIR}/util.a
 KLIBRARIES=${TOP_LIBDIR}/libauth.krb.a \
                ${TOP_LIBDIR}/librxkad.a \
-               ${TOP_LIBDIR}/libdes.a \
                ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a \
                ${TOP_LIBDIR}/libsys.a \
                ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
+               ${TOP_LIBDIR}/libafshcrypto_lwp.a \
                ${TOP_LIBDIR}/util.a
 
 #
index 6db1b8b61c8b9774bbe4dd225da31047d2d52cf9..e20ff50b27a0502d3775aea170fd695fca54cd38 100644 (file)
@@ -1582,7 +1582,6 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
 %{_includedir}/ubik.h
 %{_includedir}/ubik_int.h
 %{_libdir}/afs
-%{_libdir}/libdes.a
 %{_libdir}/liblwp.a
 %{_libdir}/librx.a
 %{_libdir}/librxkad.a
index 82e62a47efe4c6c5f38ab0032f11a063c238f708..b2a6a68f1eed1337b42585a6077110045ab9db33 100644 (file)
@@ -15,7 +15,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
    LIBS = ${TOP_LIBDIR}/libafsauthent_pic.a ${TOP_LIBDIR}/libafsrpc_pic.a \
          ${PAM_LIBS} @LIB_AFSDB@ ${MT_LIBS}
   KLIBS = ktc_krb.o ${TOP_LIBDIR}/libafsauthent_pic.a \
-         ${TOP_LIBDIR}/libafsrpc_pic.a ${PAM_LIBS} @LIB_AFSDB@ ${MT_LIBS}
+         ${TOP_LIBDIR}/libafsrpc_pic.a \
+         ${PAM_LIBS} @LIB_AFSDB@ ${MT_LIBS}
  SHOBJS = afs_account.o afs_session.o afs_password.o \
          afs_pam_msg.o afs_message.o AFS_component_version_number.o
    OBJS = $(SHOBJS) test_pam.o
@@ -61,7 +62,9 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o \
                ${TOP_LIBDIR}/libafsrpc_pic.a \
                pam_afs.map
        ../config/shlib-build -d $(srcdir) -f pam_afs.so.1 -l pam_afs -- \
-               afs_setcred.o afs_auth.o afs_util.o ${SHOBJS} ${LIBS}
+               afs_setcred.o afs_auth.o afs_util.o ${SHOBJS} \
+               ${LIBS} $(LDFLAGS_hcrypto) $(LDFLAGS_roken) \
+               $(LIB_hcrypto) $(LIB_roken)
 
 pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o \
                ktc_krb.o ${TOP_LIBDIR}/libafsauthent_pic.a \
@@ -69,7 +72,8 @@ pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o \
                pam_afs.map
        ../config/shlib-build -d $(srcdir) -f pam_afs.krb.so.1 -l pam_afs -- \
                afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o \
-               ${SHOBJS} ${KLIBS}
+               ${SHOBJS} ${KLIBS} $(LDFLAGS_hcrypto) $(LDFLAGS_roken) \
+               $(LIB_hcrypto) $(LIB_roken)
 
 test_pam: test_pam.o
        set -x; \
index d5ecfc69cc66baaafda99831d29ca44bacfb8770..c646edaa7768a3f2bc378ee3ef5dcf23a7dc7e09 100644 (file)
@@ -32,17 +32,17 @@ LINCLS=${TOP_INCDIR}/ubik.h \
        ${TOP_INCDIR}/afs/cellconfig.h \
        ptclient.h ptuser.h ptint.h pterror.h
 
-LIBS=${TOP_LIBDIR}/libubik.a \
+LIBS=   ${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
        ${TOP_LIBDIR}/librxstat.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/libsys.a \
-       ${TOP_LIBDIR}/libafsutil.a
+       ${TOP_LIBDIR}/libafsutil.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 
 all: ptserver pts pt_util db_verify ${TOP_LIBDIR}/libprot.a \
index b4f1c29f3ed6e8491b6e85f981453d1024f830f3..cb3ac5f6e0e75b17498cece4157a6e2124073ff2 100644 (file)
@@ -63,7 +63,6 @@ PTSERVER_EXELIBS =\
        $(DESTDIR)\lib\afsrxstat.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afslwp.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afs\afscom_err.lib \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsaudit.lib \
@@ -71,6 +70,7 @@ PTSERVER_EXELIBS =\
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 !IF (("$(SYS_NAME)"!="i386_win95" ) && ("$(SYS_NAME)"!="I386_WIN95" ))
@@ -114,7 +114,6 @@ PTS_EXELIBS =\
        $(DESTDIR)\lib\afsrxkad.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afslwp.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afs\afscom_err.lib \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsprot.lib \
@@ -123,6 +122,7 @@ PTS_EXELIBS =\
        $(DESTDIR)\lib\afs\afseventlog.lib \
        $(DESTDIR)\lib\afs\afspioctl.lib \
        $(DESTDIR)\lib\libafsconf.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(PTS): $(PTS_EXEOBJS) $(PTS_EXELIBS) 
index 858e691866b8c5c38aee127cc53c0070fdd78d78..d045d8b1403eb7d7f05c8d6f1c2fef50b1eb2c0a 100644 (file)
@@ -196,8 +196,6 @@ rxi_InitPthread(void)
     MUTEX_INIT(&epoch_mutex, "epoch", MUTEX_DEFAULT, 0);
     MUTEX_INIT(&rx_init_mutex, "init", MUTEX_DEFAULT, 0);
     MUTEX_INIT(&rx_event_mutex, "event", MUTEX_DEFAULT, 0);
-    MUTEX_INIT(&des_init_mutex, "des", MUTEX_DEFAULT, 0);
-    MUTEX_INIT(&des_random_mutex, "random", MUTEX_DEFAULT, 0);
     MUTEX_INIT(&osi_malloc_mutex, "malloc", MUTEX_DEFAULT, 0);
     MUTEX_INIT(&event_handler_mutex, "event handler", MUTEX_DEFAULT, 0);
     MUTEX_INIT(&rxi_connCacheMutex, "conn cache", MUTEX_DEFAULT, 0);
index 8194022bdb9d6eccf8017611d1895211bbf529df..c3f47f28e9edb5187253cbbea538bbff5eb2c0ba 100644 (file)
@@ -18,18 +18,16 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 INCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
        ${TOP_INCDIR}/rx/fcrypt.h \
-       rxkad.h rxkad_prototypes.h fcrypt.h v5gen.h \
-       hash.h md4.h md5.h
+       rxkad.h rxkad_prototypes.h fcrypt.h v5gen.h
 
 OBJS=rxkad_client.o rxkad_server.o rxkad_common.o rxkad_errs.o \
-       fcrypt.o crypt_conn.o ticket.o ticket5.o crc.o \
-       md4.o md5.o
+       fcrypt.o crypt_conn.o ticket.o ticket5.o crc.o
 
 fc_test_OBJS=fc_test.o
 
 fc_test_LIBS=\
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
        ${TOP_LIBDIR}/libafsutil.a
@@ -87,10 +85,6 @@ ticket5.o: ticket5.c v5gen.c v5der.c v5gen-rewrite.h ${INCLS}
 
 crc.o: crc.c ${INCLS}
 
-md4.o: md4.c ${INCLS}
-
-md5.o: md5.c ${INCLS}
-
 fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h
 
 crypt_conn.o: crypt_conn.c fcrypt.h private_data.h ${INCLS}
index faba33aa263787f9db1f185a9be75d18082a4564..587b437911d6873c488be9f29c21935d6b318548 100644 (file)
@@ -15,9 +15,6 @@ INCFILES =\
        $(INCFILEDIR)\rxkad_prototypes.h \
        $(INCFILEDIR)\asn1_err.h \
         $(INCFILEDIR)\v5gen.h \
-        $(INCFILEDIR)\hash.h\
-        $(INCFILEDIR)\md4.h \
-        $(INCFILEDIR)\md5.h \
        $(INCFILEDIR)\rxkad.h
 
 # build afsrxkad.lib
@@ -31,8 +28,6 @@ LIBOBJS =\
        $(OUT)\bg-fcrypt.obj \
        $(OUT)\ticket5.obj \
        $(OUT)\crc.obj \
-        $(OUT)\md4.obj \
-        $(OUT)\md5.obj \
        $(OUT)\crypt_conn.obj 
 
 $(LIBOBJS):
index 2387a18120cad9f4e0e3255cffd96bab92045c20..cadaf749bfee6789cbc2b3da512f865c08d7a96d 100644 (file)
@@ -49,7 +49,6 @@
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
-#include <des.h>
 #include "lifetimes.h"
 
 static u_long table[256];
diff --git a/src/rxkad/hash.h b/src/rxkad/hash.h
deleted file mode 100644 (file)
index 695d61e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of KTH nor the names of its contributors may be
- *    used to endorse or promote products derived from this software without
- *    specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* $Id$ */
-
-/* stuff in common between md4, md5, and sha1 */
-
-#ifndef __hash_h__
-#define __hash_h__
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef min
-#define min(a,b) (((a)>(b))?(b):(a))
-#endif
-
-/* Vector Crays doesn't have a good 32-bit type, or more precisely,
-   int32_t as defined by <bind/bitypes.h> isn't 32 bits, and we don't
-   want to depend in being able to redefine this type.  To cope with
-   this we have to clamp the result in some places to [0,2^32); no
-   need to do this on other machines.  Did I say this was a mess?
-   */
-
-#ifdef _CRAY
-#define CRAYFIX(X) ((X) & 0xffffffff)
-#else
-#define CRAYFIX(X) (X)
-#endif
-
-#if !defined(inline) && !defined(__GNUC__)
-#define inline
-#endif
-
-static inline afs_uint32
-cshift(afs_uint32 x, unsigned int n)
-{
-    x = CRAYFIX(x);
-    return CRAYFIX((x << n) | (x >> (32 - n)));
-}
-
-#endif /* __hash_h__ */
diff --git a/src/rxkad/md4.c b/src/rxkad/md4.c
deleted file mode 100644 (file)
index f7546fc..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#include <roken.h>
-
-#include <afs/stds.h>
-#include <sys/types.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#endif
-#include <string.h>
-#include <rx/xdr.h>
-#include <rx/rx.h>
-#include <rx/rxkad.h>
-#include <des.h>
-#include "lifetimes.h"
-#include "md4.h"
-#include "hash.h"
-
-#define A m->counter[0]
-#define B m->counter[1]
-#define C m->counter[2]
-#define D m->counter[3]
-#define X data
-
-void
-MD4_Init(struct md4 *m)
-{
-    m->sz[0] = 0;
-    m->sz[1] = 0;
-    D = 0x10325476;
-    C = 0x98badcfe;
-    B = 0xefcdab89;
-    A = 0x67452301;
-}
-
-#define F(x,y,z) CRAYFIX((x & y) | (~x & z))
-#define G(x,y,z) ((x & y) | (x & z) | (y & z))
-#define H(x,y,z) (x ^ y ^ z)
-
-#define DOIT(a,b,c,d,k,s,i,OP) \
-a = cshift(a + OP(b,c,d) + X[k] + i, s)
-
-#define DO1(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,F)
-#define DO2(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,G)
-#define DO3(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,H)
-
-static inline void
-calc(struct md4 *m, afs_uint32 * data)
-{
-    afs_uint32 AA, BB, CC, DD;
-
-    AA = A;
-    BB = B;
-    CC = C;
-    DD = D;
-
-    /* Round 1 */
-
-    DO1(A, B, C, D, 0, 3, 0);
-    DO1(D, A, B, C, 1, 7, 0);
-    DO1(C, D, A, B, 2, 11, 0);
-    DO1(B, C, D, A, 3, 19, 0);
-
-    DO1(A, B, C, D, 4, 3, 0);
-    DO1(D, A, B, C, 5, 7, 0);
-    DO1(C, D, A, B, 6, 11, 0);
-    DO1(B, C, D, A, 7, 19, 0);
-
-    DO1(A, B, C, D, 8, 3, 0);
-    DO1(D, A, B, C, 9, 7, 0);
-    DO1(C, D, A, B, 10, 11, 0);
-    DO1(B, C, D, A, 11, 19, 0);
-
-    DO1(A, B, C, D, 12, 3, 0);
-    DO1(D, A, B, C, 13, 7, 0);
-    DO1(C, D, A, B, 14, 11, 0);
-    DO1(B, C, D, A, 15, 19, 0);
-
-    /* Round 2 */
-
-    DO2(A, B, C, D, 0, 3, 0x5A827999);
-    DO2(D, A, B, C, 4, 5, 0x5A827999);
-    DO2(C, D, A, B, 8, 9, 0x5A827999);
-    DO2(B, C, D, A, 12, 13, 0x5A827999);
-
-    DO2(A, B, C, D, 1, 3, 0x5A827999);
-    DO2(D, A, B, C, 5, 5, 0x5A827999);
-    DO2(C, D, A, B, 9, 9, 0x5A827999);
-    DO2(B, C, D, A, 13, 13, 0x5A827999);
-
-    DO2(A, B, C, D, 2, 3, 0x5A827999);
-    DO2(D, A, B, C, 6, 5, 0x5A827999);
-    DO2(C, D, A, B, 10, 9, 0x5A827999);
-    DO2(B, C, D, A, 14, 13, 0x5A827999);
-
-    DO2(A, B, C, D, 3, 3, 0x5A827999);
-    DO2(D, A, B, C, 7, 5, 0x5A827999);
-    DO2(C, D, A, B, 11, 9, 0x5A827999);
-    DO2(B, C, D, A, 15, 13, 0x5A827999);
-
-    /* Round 3 */
-
-    DO3(A, B, C, D, 0, 3, 0x6ED9EBA1);
-    DO3(D, A, B, C, 8, 9, 0x6ED9EBA1);
-    DO3(C, D, A, B, 4, 11, 0x6ED9EBA1);
-    DO3(B, C, D, A, 12, 15, 0x6ED9EBA1);
-
-    DO3(A, B, C, D, 2, 3, 0x6ED9EBA1);
-    DO3(D, A, B, C, 10, 9, 0x6ED9EBA1);
-    DO3(C, D, A, B, 6, 11, 0x6ED9EBA1);
-    DO3(B, C, D, A, 14, 15, 0x6ED9EBA1);
-
-    DO3(A, B, C, D, 1, 3, 0x6ED9EBA1);
-    DO3(D, A, B, C, 9, 9, 0x6ED9EBA1);
-    DO3(C, D, A, B, 5, 11, 0x6ED9EBA1);
-    DO3(B, C, D, A, 13, 15, 0x6ED9EBA1);
-
-    DO3(A, B, C, D, 3, 3, 0x6ED9EBA1);
-    DO3(D, A, B, C, 11, 9, 0x6ED9EBA1);
-    DO3(C, D, A, B, 7, 11, 0x6ED9EBA1);
-    DO3(B, C, D, A, 15, 15, 0x6ED9EBA1);
-
-    A += AA;
-    B += BB;
-    C += CC;
-    D += DD;
-}
-
-/*
- * From `Performance analysis of MD5' by Joseph D. Touch <touch@isi.edu>
- */
-
-#if defined(WORDS_BIGENDIAN)
-static inline afs_uint32
-swap_afs_uint32(afs_uint32 t)
-{
-    afs_uint32 temp1, temp2;
-
-    temp1 = cshift(t, 16);
-    temp2 = temp1 >> 8;
-    temp1 &= 0x00ff00ff;
-    temp2 &= 0x00ff00ff;
-    temp1 <<= 8;
-    return temp1 | temp2;
-}
-#endif
-
-struct x32 {
-    unsigned int a:32;
-    unsigned int b:32;
-};
-
-void
-MD4_Update(struct md4 *m, const void *v, size_t len)
-{
-    const unsigned char *p = v;
-    size_t old_sz = m->sz[0];
-    size_t offset;
-
-    m->sz[0] += len * 8;
-    if (m->sz[0] < old_sz)
-       ++m->sz[1];
-    offset = (old_sz / 8) % 64;
-    while (len > 0) {
-       size_t l = min(len, 64 - offset);
-       memcpy(m->save + offset, p, l);
-       offset += l;
-       p += l;
-       len -= l;
-       if (offset == 64) {
-#if defined(WORDS_BIGENDIAN)
-           int i;
-           afs_uint32 current[16];
-           struct x32 *u = (struct x32 *)m->save;
-           for (i = 0; i < 8; i++) {
-               current[2 * i + 0] = swap_afs_uint32(u[i].a);
-               current[2 * i + 1] = swap_afs_uint32(u[i].b);
-           }
-           calc(m, current);
-#else
-           calc(m, (afs_uint32 *) m->save);
-#endif
-           offset = 0;
-       }
-    }
-}
-
-void
-MD4_Final(void *res, struct md4 *m)
-{
-    static unsigned char zeros[72];
-    unsigned offset = (m->sz[0] / 8) % 64;
-    unsigned int dstart = (120 - offset - 1) % 64 + 1;
-
-    *zeros = 0x80;
-    memset(zeros + 1, 0, sizeof(zeros) - 1);
-    zeros[dstart + 0] = (m->sz[0] >> 0) & 0xff;
-    zeros[dstart + 1] = (m->sz[0] >> 8) & 0xff;
-    zeros[dstart + 2] = (m->sz[0] >> 16) & 0xff;
-    zeros[dstart + 3] = (m->sz[0] >> 24) & 0xff;
-    zeros[dstart + 4] = (m->sz[1] >> 0) & 0xff;
-    zeros[dstart + 5] = (m->sz[1] >> 8) & 0xff;
-    zeros[dstart + 6] = (m->sz[1] >> 16) & 0xff;
-    zeros[dstart + 7] = (m->sz[1] >> 24) & 0xff;
-    MD4_Update(m, zeros, dstart + 8);
-    {
-       int i;
-       unsigned char *r = (unsigned char *)res;
-
-       for (i = 0; i < 4; ++i) {
-           r[4 * i] = m->counter[i] & 0xFF;
-           r[4 * i + 1] = (m->counter[i] >> 8) & 0xFF;
-           r[4 * i + 2] = (m->counter[i] >> 16) & 0xFF;
-           r[4 * i + 3] = (m->counter[i] >> 24) & 0xFF;
-       }
-    }
-#if 0
-    {
-       int i;
-       afs_uint32 *r = (afs_uint32 *) res;
-
-       for (i = 0; i < 4; ++i)
-           r[i] = swap_afs_uint32(m->counter[i]);
-    }
-#endif
-}
diff --git a/src/rxkad/md4.h b/src/rxkad/md4.h
deleted file mode 100644 (file)
index ec2ca63..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Id$ */
-
-#include <stdlib.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-
-struct md4 {
-    unsigned int sz[2];
-    afs_uint32 counter[4];
-    unsigned char save[64];
-};
-
-typedef struct md4 MD4_CTX;
-
-void MD4_Init(struct md4 *m);
-void MD4_Update(struct md4 *m, const void *p, size_t len);
-void MD4_Final(void *res, struct md4 *m);
diff --git a/src/rxkad/md5.c b/src/rxkad/md5.c
deleted file mode 100644 (file)
index dea93d6..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#include <roken.h>
-
-#include <afs/stds.h>
-#include <sys/types.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#endif
-#include <string.h>
-#include <rx/rx.h>
-#include <rx/rxkad.h>
-#include <des.h>
-#include "lifetimes.h"
-
-#include "md5.h"
-#include "hash.h"
-
-#define A m->counter[0]
-#define B m->counter[1]
-#define C m->counter[2]
-#define D m->counter[3]
-#define X data
-
-void
-MD5_Init(struct md5 *m)
-{
-    m->sz[0] = 0;
-    m->sz[1] = 0;
-    D = 0x10325476;
-    C = 0x98badcfe;
-    B = 0xefcdab89;
-    A = 0x67452301;
-}
-
-#define F(x,y,z) CRAYFIX((x & y) | (~x & z))
-#define G(x,y,z) CRAYFIX((x & z) | (y & ~z))
-#define H(x,y,z) (x ^ y ^ z)
-#define I(x,y,z) CRAYFIX(y ^ (x | ~z))
-
-#define DOIT(a,b,c,d,k,s,i,OP) \
-a = b + cshift(a + OP(b,c,d) + X[k] + (i), s)
-
-#define DO1(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,F)
-#define DO2(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,G)
-#define DO3(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,H)
-#define DO4(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,I)
-
-static inline void
-calc(struct md5 *m, afs_uint32 * data)
-{
-    afs_uint32 AA, BB, CC, DD;
-
-    AA = A;
-    BB = B;
-    CC = C;
-    DD = D;
-
-    /* Round 1 */
-
-    DO1(A, B, C, D, 0, 7, 0xd76aa478);
-    DO1(D, A, B, C, 1, 12, 0xe8c7b756);
-    DO1(C, D, A, B, 2, 17, 0x242070db);
-    DO1(B, C, D, A, 3, 22, 0xc1bdceee);
-
-    DO1(A, B, C, D, 4, 7, 0xf57c0faf);
-    DO1(D, A, B, C, 5, 12, 0x4787c62a);
-    DO1(C, D, A, B, 6, 17, 0xa8304613);
-    DO1(B, C, D, A, 7, 22, 0xfd469501);
-
-    DO1(A, B, C, D, 8, 7, 0x698098d8);
-    DO1(D, A, B, C, 9, 12, 0x8b44f7af);
-    DO1(C, D, A, B, 10, 17, 0xffff5bb1);
-    DO1(B, C, D, A, 11, 22, 0x895cd7be);
-
-    DO1(A, B, C, D, 12, 7, 0x6b901122);
-    DO1(D, A, B, C, 13, 12, 0xfd987193);
-    DO1(C, D, A, B, 14, 17, 0xa679438e);
-    DO1(B, C, D, A, 15, 22, 0x49b40821);
-
-    /* Round 2 */
-
-    DO2(A, B, C, D, 1, 5, 0xf61e2562);
-    DO2(D, A, B, C, 6, 9, 0xc040b340);
-    DO2(C, D, A, B, 11, 14, 0x265e5a51);
-    DO2(B, C, D, A, 0, 20, 0xe9b6c7aa);
-
-    DO2(A, B, C, D, 5, 5, 0xd62f105d);
-    DO2(D, A, B, C, 10, 9, 0x2441453);
-    DO2(C, D, A, B, 15, 14, 0xd8a1e681);
-    DO2(B, C, D, A, 4, 20, 0xe7d3fbc8);
-
-    DO2(A, B, C, D, 9, 5, 0x21e1cde6);
-    DO2(D, A, B, C, 14, 9, 0xc33707d6);
-    DO2(C, D, A, B, 3, 14, 0xf4d50d87);
-    DO2(B, C, D, A, 8, 20, 0x455a14ed);
-
-    DO2(A, B, C, D, 13, 5, 0xa9e3e905);
-    DO2(D, A, B, C, 2, 9, 0xfcefa3f8);
-    DO2(C, D, A, B, 7, 14, 0x676f02d9);
-    DO2(B, C, D, A, 12, 20, 0x8d2a4c8a);
-
-    /* Round 3 */
-
-    DO3(A, B, C, D, 5, 4, 0xfffa3942);
-    DO3(D, A, B, C, 8, 11, 0x8771f681);
-    DO3(C, D, A, B, 11, 16, 0x6d9d6122);
-    DO3(B, C, D, A, 14, 23, 0xfde5380c);
-
-    DO3(A, B, C, D, 1, 4, 0xa4beea44);
-    DO3(D, A, B, C, 4, 11, 0x4bdecfa9);
-    DO3(C, D, A, B, 7, 16, 0xf6bb4b60);
-    DO3(B, C, D, A, 10, 23, 0xbebfbc70);
-
-    DO3(A, B, C, D, 13, 4, 0x289b7ec6);
-    DO3(D, A, B, C, 0, 11, 0xeaa127fa);
-    DO3(C, D, A, B, 3, 16, 0xd4ef3085);
-    DO3(B, C, D, A, 6, 23, 0x4881d05);
-
-    DO3(A, B, C, D, 9, 4, 0xd9d4d039);
-    DO3(D, A, B, C, 12, 11, 0xe6db99e5);
-    DO3(C, D, A, B, 15, 16, 0x1fa27cf8);
-    DO3(B, C, D, A, 2, 23, 0xc4ac5665);
-
-    /* Round 4 */
-
-    DO4(A, B, C, D, 0, 6, 0xf4292244);
-    DO4(D, A, B, C, 7, 10, 0x432aff97);
-    DO4(C, D, A, B, 14, 15, 0xab9423a7);
-    DO4(B, C, D, A, 5, 21, 0xfc93a039);
-
-    DO4(A, B, C, D, 12, 6, 0x655b59c3);
-    DO4(D, A, B, C, 3, 10, 0x8f0ccc92);
-    DO4(C, D, A, B, 10, 15, 0xffeff47d);
-    DO4(B, C, D, A, 1, 21, 0x85845dd1);
-
-    DO4(A, B, C, D, 8, 6, 0x6fa87e4f);
-    DO4(D, A, B, C, 15, 10, 0xfe2ce6e0);
-    DO4(C, D, A, B, 6, 15, 0xa3014314);
-    DO4(B, C, D, A, 13, 21, 0x4e0811a1);
-
-    DO4(A, B, C, D, 4, 6, 0xf7537e82);
-    DO4(D, A, B, C, 11, 10, 0xbd3af235);
-    DO4(C, D, A, B, 2, 15, 0x2ad7d2bb);
-    DO4(B, C, D, A, 9, 21, 0xeb86d391);
-
-    A += AA;
-    B += BB;
-    C += CC;
-    D += DD;
-}
-
-/*
- * From `Performance analysis of MD5' by Joseph D. Touch <touch@isi.edu>
- */
-
-#if defined(WORDS_BIGENDIAN)
-static inline afs_uint32
-swap_afs_uint32(afs_uint32 t)
-{
-    afs_uint32 temp1, temp2;
-
-    temp1 = cshift(t, 16);
-    temp2 = temp1 >> 8;
-    temp1 &= 0x00ff00ff;
-    temp2 &= 0x00ff00ff;
-    temp1 <<= 8;
-    return temp1 | temp2;
-}
-#endif
-
-struct x32 {
-    unsigned int a:32;
-    unsigned int b:32;
-};
-
-void
-MD5_Update(struct md5 *m, const void *v, size_t len)
-{
-    const unsigned char *p = v;
-    size_t old_sz = m->sz[0];
-    size_t offset;
-
-    m->sz[0] += len * 8;
-    if (m->sz[0] < old_sz)
-       ++m->sz[1];
-    offset = (old_sz / 8) % 64;
-    while (len > 0) {
-       size_t l = min(len, 64 - offset);
-       memcpy(m->save + offset, p, l);
-       offset += l;
-       p += l;
-       len -= l;
-       if (offset == 64) {
-#if defined(WORDS_BIGENDIAN)
-           int i;
-           afs_uint32 current[16];
-           struct x32 *u = (struct x32 *)m->save;
-           for (i = 0; i < 8; i++) {
-               current[2 * i + 0] = swap_afs_uint32(u[i].a);
-               current[2 * i + 1] = swap_afs_uint32(u[i].b);
-           }
-           calc(m, current);
-#else
-           calc(m, (afs_uint32 *) m->save);
-#endif
-           offset = 0;
-       }
-    }
-}
-
-void
-MD5_Final(void *res, struct md5 *m)
-{
-    static unsigned char zeros[72];
-    unsigned offset = (m->sz[0] / 8) % 64;
-    unsigned int dstart = (120 - offset - 1) % 64 + 1;
-
-    *zeros = 0x80;
-    memset(zeros + 1, 0, sizeof(zeros) - 1);
-    zeros[dstart + 0] = (m->sz[0] >> 0) & 0xff;
-    zeros[dstart + 1] = (m->sz[0] >> 8) & 0xff;
-    zeros[dstart + 2] = (m->sz[0] >> 16) & 0xff;
-    zeros[dstart + 3] = (m->sz[0] >> 24) & 0xff;
-    zeros[dstart + 4] = (m->sz[1] >> 0) & 0xff;
-    zeros[dstart + 5] = (m->sz[1] >> 8) & 0xff;
-    zeros[dstart + 6] = (m->sz[1] >> 16) & 0xff;
-    zeros[dstart + 7] = (m->sz[1] >> 24) & 0xff;
-    MD5_Update(m, zeros, dstart + 8);
-    {
-       int i;
-       unsigned char *r = (unsigned char *)res;
-
-       for (i = 0; i < 4; ++i) {
-           r[4 * i] = m->counter[i] & 0xFF;
-           r[4 * i + 1] = (m->counter[i] >> 8) & 0xFF;
-           r[4 * i + 2] = (m->counter[i] >> 16) & 0xFF;
-           r[4 * i + 3] = (m->counter[i] >> 24) & 0xFF;
-       }
-    }
-#if 0
-    {
-       int i;
-       afs_uint32 *r = (afs_uint32 *) res;
-
-       for (i = 0; i < 4; ++i)
-           r[i] = swap_afs_uint32(m->counter[i]);
-    }
-#endif
-}
diff --git a/src/rxkad/md5.h b/src/rxkad/md5.h
deleted file mode 100644 (file)
index cfaea84..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Id$ */
-
-#include <stdlib.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-
-struct md5 {
-    unsigned int sz[2];
-    afs_uint32 counter[4];
-    unsigned char save[64];
-};
-
-typedef struct md5 MD5_CTX;
-
-void MD5_Init(struct md5 *m);
-void MD5_Update(struct md5 *m, const void *p, size_t len);
-void MD5_Final(void *res, struct md5 *m);      /* afs_uint32 res[4] */
index 1bd30a1bbacd150529b1785f6ac6ebf9efc56c45..71da356eec39cebc155d5bef5382d7f6bb9889de 100644 (file)
 #include "fcrypt.h"
 #include "rx/rx.h"
 
-/* Don't include des.h where it can cause conflict with krb4 headers */
-#if !defined(NO_DES_H_INCLUDE)
-#include <des.h>
-#endif
+#include <hcrypto/des.h>
 
 /* crypt_conn.c */
 extern afs_int32 rxkad_DecryptPacket(const struct rx_connection *conn,
@@ -161,10 +158,9 @@ extern int tkt_DecodeTicket5(char *ticket, afs_int32 ticket_len,
                             afs_int32 * host, afs_uint32 * start,
                             afs_uint32 * end, afs_int32 disableDotCheck);
 
-#if !defined(NO_DES_H_INCLUDE)
-static_inline unsigned char *
+static_inline DES_cblock *
 ktc_to_cblock(struct ktc_encryptionKey *key) {
-    return (unsigned char *)key;
+    return (DES_cblock *)key;
 }
 
 static_inline char *
@@ -172,11 +168,27 @@ ktc_to_charptr(struct ktc_encryptionKey *key) {
     return (char *)key;
 }
 
-static_inline des_cblock *
+
+static_inline DES_cblock *
 ktc_to_cblockptr(struct ktc_encryptionKey *key) {
-    return (des_cblock *)key;
+    return (DES_cblock *)key;
+}
+
+#if 0
+static_inline unsigned char *
+cblockptr_to_cblock(DES_cblock *key) {
+    return (unsigned char *)key;
 }
 #endif
 
+static_inline DES_cblock *
+charptr_to_cblock(char *key) {
+    return (DES_cblock *)key;
+}
+
+static_inline DES_cblock *
+charptr_to_cblockptr(char *key) {
+    return (DES_cblock *)key;
+}
 
 #endif
index 6d3463656d0f10bdd7f8407f295ee2bcae81e0ff..91c74dc63a1891ebfd43938699be515ea17dc224 100644 (file)
@@ -30,7 +30,6 @@
 #include <string.h>
 #include <rx/rx.h>
 #include <rx/xdr.h>
-#include <des.h>
 #include <afs/afsutil.h>
 #ifdef HAVE_STDINT_H
 # include <stdint.h>
index 97ce9736230c9966df9920b8a5f39db3bf4f8fd8..e3fdd3d30c606f84524c0e13026aff816e3fc1c5 100644 (file)
@@ -25,7 +25,7 @@ LIBS=${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/libsys.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/util.a
index 1c5d9e573526810b27b1e19803d58a8e2610a39c..774a7f2d34e485fcd03ae47d085cb9ed88a5b49f 100644 (file)
@@ -13,7 +13,6 @@
 #include <roken.h>
 
 #include <stdio.h>
-
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -22,8 +21,6 @@
 #include <netinet/in.h>
 #endif
 #include <string.h>
-#include <des.h>
-#include <des_prototypes.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include "lifetimes.h"
@@ -35,7 +32,7 @@
  * application uses both rxkad and openssl.
  */
 union Key_schedule_safe {
-    Key_schedule schedule;
+    DES_key_schedule schedule;
     struct {
        union {
            char cblock[8];
@@ -117,11 +114,11 @@ tkt_DecodeTicket(char *asecret, afs_int32 ticketLen,
        ((ticketLen) % 8 != 0)) /* enc. part must be (0 mod 8) bytes */
        return RXKADBADTICKET;
 
-    if (key_sched(ktc_to_cblock(key), schedule.schedule))
+    if (DES_key_sched(ktc_to_cblock(key), &schedule.schedule))
        return RXKADBADKEY;
 
     ticket = clear_ticket;
-    pcbc_encrypt(asecret, ticket, ticketLen, schedule.schedule, ktc_to_cblockptr(key), DECRYPT);
+    DES_pcbc_encrypt(asecret, ticket, ticketLen, &schedule.schedule, ktc_to_cblockptr(key), DECRYPT);
 
     code =
        decode_athena_ticket(ticket, ticketLen, name, inst, cell, host,
@@ -215,11 +212,12 @@ tkt_MakeTicket(char *ticket, int *ticketLen, struct ktc_encryptionKey *key,
        return -1;
 
     /* encrypt ticket */
-    if ((code = key_sched(ktc_to_cblock(key), schedule.schedule))) {
+    if ((code = DES_key_sched(ktc_to_cblock(key), &schedule.schedule))) {
        printf("In tkt_MakeTicket: key_sched returned %d\n", code);
        return RXKADBADKEY;
     }
-    pcbc_encrypt(ticket, ticket, *ticketLen, schedule.schedule, ktc_to_cblockptr(key), ENCRYPT);
+    DES_pcbc_encrypt(ticket, ticket, *ticketLen, &schedule.schedule,
+                    ktc_to_cblockptr(key), ENCRYPT);
     return 0;
 }
 
index aee11f1def2a0570761103dda48e090ec9a94c9e..f7bf5ddeb6de7c9a8c918efea501da288339f660 100644 (file)
@@ -73,6 +73,8 @@
 #include <string.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
+#include <hcrypto/md4.h>
+#include <hcrypto/md5.h>
 #include "lifetimes.h"
 #include "rxkad.h"
 
@@ -81,8 +83,6 @@
 #include "der.h"
 #include "v5der.c"
 #include "v5gen.c"
-#include "md4.h"
-#include "md5.h"
 
 /*
  * Principal conversion Taken from src/lib/krb5/krb/conv_princ from MIT Kerberos.  If you
  * bug with MIT by sending mail to krb5-bugs@mit.edu.
  */
 
-extern afs_int32 des_cbc_encrypt(void * in, void * out,
-                                 afs_int32 length,
-                                 des_key_schedule key, des_cblock *iv,
-                                 int encrypt);
-extern int des_key_sched(des_cblock k, des_key_schedule schedule);
-
 struct krb_convert {
     char *v4_str;
     char *v5_str;
@@ -432,15 +426,15 @@ krb5_des_decrypt(struct ktc_encryptionKey *key, int etype, void *in,
 {
     int (*cksum_func) (void *, size_t, void *, size_t,
                       struct ktc_encryptionKey *);
-    des_cblock ivec;
-    des_key_schedule s;
+    DES_cblock ivec;
+    DES_key_schedule s;
     char cksum[24];
     size_t cksumsz;
     int ret = 1;               /* failure */
 
     cksum_func = NULL;
 
-    des_key_sched(ktc_to_cblock(key), (struct des_ks_struct *)&s);
+    DES_key_sched(ktc_to_cblock(key), &s);
 
 #define CONFOUNDERSZ 8
 
@@ -464,7 +458,7 @@ krb5_des_decrypt(struct ktc_encryptionKey *key, int etype, void *in,
        abort();
     }
 
-    des_cbc_encrypt(in, out, insz, s, &ivec, 0);
+    DES_cbc_encrypt(in, out, insz, &s, &ivec, 0);
 
     memcpy(cksum, (char *)out + CONFOUNDERSZ, cksumsz);
     memset((char *)out + CONFOUNDERSZ, 0, cksumsz);
index 6a3d7a108fef0c5b5c658b69dff6326decfa781c..c5955f91b929f706c1087f0b4da072bf36dbd66a 100644 (file)
@@ -34,9 +34,9 @@ LIBS=${TOP_LIBDIR}/libgtx.a \
        ${TOP_LIBDIR}/libkauth.a \
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcmd.a \
-       ${TOP_LIBDIR}/vlib.a ${TOP_LIBDIR}/libacl.a \
+       ${TOP_LIBDIR}/vlib.a \
+       ${TOP_LIBDIR}/libacl.a \
         ${TOP_LIBDIR}/libvldb.a \
        ${TOP_LIBDIR}/libafsint.a \
        ${TOP_LIBDIR}/libsys.a \
@@ -45,6 +45,7 @@ LIBS=${TOP_LIBDIR}/libgtx.a \
        ${TOP_LIBDIR}/libaudit.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/liblwp.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/util.a
 
 all: scout
index 09a03d1e3b7d68a9792f854e77e8b30201a13b9a..d5fd951226441158e0994808fce5234a57bc5628 100644 (file)
@@ -22,14 +22,32 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 # machine then that will be used ..
 #
 LIBDIR=${TOP_LIBDIR}/
-AFSLIBS=${TOP_LIBDIR}/libkauth.a ${TOP_LIBDIR}/libprot.a ${LIBDIR}/libubik.a \
-         ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libsys.a \
-         ${TOP_LIBDIR}/libdes.a ${LIBDIR}/librx.a ${LIBDIR}/liblwp.a \
-          ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
-KAFSLIBS=${TOP_LIBDIR}/libkauth.krb.a ${TOP_LIBDIR}/libprot.a ${LIBDIR}/libubik.a \
-         ${TOP_LIBDIR}/libauth.krb.a ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libsys.a \
-         ${TOP_LIBDIR}/libdes.a ${LIBDIR}/librx.a ${LIBDIR}/liblwp.a \
-          ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
+AFSLIBS=${TOP_LIBDIR}/libkauth.a \
+       ${TOP_LIBDIR}/libprot.a \
+       ${LIBDIR}/libubik.a \
+       ${TOP_LIBDIR}/libauth.a \
+       ${TOP_LIBDIR}/librxkad.a \
+       ${TOP_LIBDIR}/libsys.a \
+       ${LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
+       ${LIBDIR}/liblwp.a \
+        ${TOP_LIBDIR}/libcmd.a \
+       ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/util.a
+
+KAFSLIBS=${TOP_LIBDIR}/libkauth.krb.a \
+       ${TOP_LIBDIR}/libprot.a \
+       ${LIBDIR}/libubik.a \
+       ${TOP_LIBDIR}/libauth.krb.a \
+       ${TOP_LIBDIR}/librxkad.a \
+       ${TOP_LIBDIR}/libsys.a \
+       ${LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
+       ${LIBDIR}/liblwp.a \
+        ${TOP_LIBDIR}/libcmd.a \
+       ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/util.a
+
 AUTHFILES=ta-rauth.o rcmd.o herror.o
 AUTHLIBS=afsauthlib.so afskauthlib.so
 TARGETS=$(AUTHLIBS) 
index 3edd7c8ca2d4347854a511f226e01779bc554766..2b07380752390243a4f4d1618e8961d6e95cd3eb 100644 (file)
@@ -55,8 +55,7 @@ KAUTHOBJS = \
        kautils.o \
        kalocalcell.o \
        kaerrors.o \
-       user.o \
-       read_passwd.o
+       user.o
 
 UBIKOBJS = \
        uinit.o \
@@ -133,9 +132,9 @@ dest: ${LIBAFSAUTHENT} libafsauthent_pic.a
 ${LIBAFSAUTHENT}: ${LIBOBJS} libafsauthent.map
        ../config/shlib-build -d $(srcdir) -l libafsauthent \
                -M ${LIBAFSAUTHENTMAJOR} -m ${LIBAFSAUTHENTMINOR} -- \
-               -L${TOP_LIBDIR} $(LDFLAGS_roken) \
+               -L${TOP_LIBDIR} $(LDFLAGS_roken) $(LDFLAGS_hcrypto) \
                $(LIBOBJS) \
-               -lafsrpc $(LIB_roken) $(LIB_crypt) $(LIB_AFSDB) \
+               -lafsrpc $(LIB_hcrypto) $(LIB_roken) $(LIB_crypt) $(LIB_AFSDB) \
                ${MT_LIBS}
 
 libafsauthent_pic.a: ${LIBOBJS}
index 5f67a1d01e0f2126e7fb432670e207577a1c2260..619ef4a6c733bd673b11850d3f3b8b012e143e33 100644 (file)
@@ -31,7 +31,6 @@ RX = $(srcdir)/../rx
 RXKAD = $(srcdir)/../rxkad
 RXSTAT = $(srcdir)/../rxstat
 FSINT = $(srcdir)/../fsint
-DES = $(srcdir)/../des
 COMERR = $(srcdir)/../comerr
 UTIL = $(srcdir)/../util
 SYS = ${srcdir}/../sys
@@ -102,40 +101,19 @@ RXKADOBJS =\
        ticket.o \
        ticket5.o \
        crc.o \
-       md4.o \
-       md5.o \
        fcrypt.o \
        crypt_conn.o
 
-DESOBJS =\
-       des.o \
-       cbc_encrypt.o \
-       pcbc_encrypt.o \
-       cksum.o \
-       new_rnd_key.o \
-       key_sched.o \
-       debug_decl.o \
-       quad_cksum.o \
-       key_parity.o \
-       weak_key.o \
-       strng_to_key.o \
-       misc.o \
-       util.o
-
-CRYPT_OBJ = crypt.o
-
 LWPOBJS = \
        fasttime.o
 
 LIBOBJS = \
        ${RXOBJS} \
-       ${DESOBJS} \
        ${XDROBJS} \
        ${RXKADOBJS} \
        ${COMERROBJS} \
        ${UTILOBJS} \
        ${SYSOBJS} \
-       ${CRYPT_OBJ} \
        ${RXSTATOBJS} \
        ${LWPOBJS} \
        ${FSINTOBJS}
@@ -164,7 +142,8 @@ dest: ${LIBAFSRPC} libafsrpc_pic.a
 ${LIBAFSRPC}: ${LIBOBJS} libafsrpc.map
        ../config/shlib-build -d $(srcdir) -l libafsrpc \
                -M ${LIBAFSRPCMAJOR} -m ${LIBAFSRPCMINOR} -- \
-               $(LDFLAGS_roken) ${LIBOBJS} ${MT_LIBS} $(LIB_roken)
+               $(LDFLAGS_roken) $(LDFLAGS_hcrypto) \
+               ${LIBOBJS} $(LIB_hcrypto) $(LIB_roken) $(MT_LIBS)
 
 libafsrpc_pic.a: ${LIBOBJS}
        $(RM) -f $@
@@ -238,12 +217,6 @@ ticket5.o: ${RXKAD}/ticket5.c
 crc.o: ${RXKAD}/crc.c
        $(AFS_CCRULE) -I../rxkad $(RXKAD)/crc.c
 
-md4.o: ${RXKAD}/md4.c
-       $(AFS_CCRULE) -I../rxkad $(RXKAD)/md4.c
-
-md5.o: ${RXKAD}/md5.c
-       $(AFS_CCRULE) -I../rxkad $(RXKAD)/md5.c
-
 fcrypt.o: ${RXKAD}/fcrypt.c
        $(AFS_CCRULE) -I../rxkad $(RXKAD)/fcrypt.c
 
@@ -292,84 +265,6 @@ xdr_update.o: ${RX}/xdr_update.c
 xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
        $(AFS_CCRULE) $(RX)/xdr_afsuuid.c
 
-# Note that the special case statement for compiling des.c is present
-# simply to work around a compiler bug on HP-UX 11.0.  The symptom of
-# the problem is that linking the pthread fileserver fails with messages
-# such as
-#
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[411] out of synch
-#   Please contact your HP Support representative
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[442] out of synch
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[450] out of synch
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[529] out of synch
-#   pxdb internal warning: cu[84]: SLT_SRCFILE[544] out of synch
-#   ...
-#   pxdb32: internal error. File won't be debuggable (still a valid executable)
-#   *** Error exit code 10
-#
-# The problematic version of pxdb is:
-#
-#   $ what /opt/langtools/bin/pxdb32
-#   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision$
-#
-# The problem occurs when -g and -O are both used when compiling des.c.
-# The simplest way to work around the problem is to leave out either -g or -O.
-# Since des.c is relatively stable I've chosen to eliminate -g rather
-# than take any hit in performance.
-
-des.o: ${DES}/des.c
-       set -x; \
-       case ${SYS_NAME} in \
-       hp_ux11*) \
-               set X `echo ${AFS_CCRULE} ${DES}/des.c | sed s/-g//`; shift; \
-               "$$@" -I../des \
-               ;; \
-       *) \
-               ${AFS_CCRULE} -I../des ${DES}/des.c \
-               ;; \
-       esac
-
-
-crypt.o: ${DES}/crypt.c
-       $(AFS_CCRULE) $(DES)/crypt.c
-
-cbc_encrypt.o: ${DES}/cbc_encrypt.c
-       $(AFS_CCRULE) $(DES)/cbc_encrypt.c
-
-pcbc_encrypt.o: ${DES}/pcbc_encrypt.c
-       $(AFS_CCRULE) $(DES)/pcbc_encrypt.c
-
-cksum.o: ${DES}/cksum.c
-       $(AFS_CCRULE) $(DES)/cksum.c
-
-new_rnd_key.o: ${DES}/new_rnd_key.c
-       $(AFS_CCRULE) $(DES)/new_rnd_key.c
-
-key_sched.o: ${DES}/key_sched.c
-       $(AFS_CCRULE) -I../des $(DES)/key_sched.c
-
-debug_decl.o: ${DES}/debug_decl.c
-       $(AFS_CCRULE) $(DES)/debug_decl.c
-
-quad_cksum.o: ${DES}/quad_cksum.c
-       $(AFS_CCRULE) $(DES)/quad_cksum.c
-
-key_parity.o: ${DES}/key_parity.c
-       $(AFS_CCRULE) -I../des $(DES)/key_parity.c
-
-weak_key.o: ${DES}/weak_key.c
-       $(AFS_CCRULE) $(DES)/weak_key.c
-
-strng_to_key.o: ${DES}/strng_to_key.c
-       $(AFS_CCRULE) $(DES)/strng_to_key.c
-
-misc.o: ${DES}/misc.c
-       $(AFS_CCRULE) $(DES)/misc.c
-
-util.o: ${DES}/util.c
-       $(AFS_CCRULE) $(DES)/util.c
-
 error_msg.o: ${COMERR}/error_msg.c
        $(AFS_CCRULE) $(COMERR)/error_msg.c
 
index 0a3d9fe1c6c5eadf0f880a9e93df40f3a51ec689..ac4af97f93aa807427cb2267a4b6d145bb523180 100755 (executable)
@@ -7,16 +7,6 @@
 
 {
     global:
-       des_check_key_parity;
-       des_fixup_key_parity;
-       des_init_random_number_generator;
-       des_is_weak_key;
-       des_key_sched;
-       des_random_key;
-       des_string_to_key;
-       des_cbc_cksum;
-       des_ecb_encrypt;
-       des_pcbc_encrypt;
        ktohl;
        life_to_time;
        osi_AssertFailU;
index 958d5f7a14b6da1657d16bc6052e5d2cfba0ce83..ec1aefd9df7868198443211382e0d04ea8462357 100644 (file)
@@ -17,7 +17,13 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 SFLAGS=-I${TOP_INCDIR}
-LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
+LIBS=libsys.a \
+     ${TOP_LIBDIR}/librx.a \
+     libsys.a \
+     ${TOP_LIBDIR}/liblwp.a \
+     ${TOP_LIBDIR}/util.a \
+     ${TOP_LIBDIR}/libafshcrypto_lwp.a \
+     ${XLIBS}
 
 OBJECTS= afssyscalls.o setpag.o pioctl.o glue.o \
        AFS_component_version_number.o
@@ -158,9 +164,9 @@ CFLAGS_pagsh.krb.o = -DAFS_KERBEROS_ENV
 pagsh.krb.o: pagsh.c
        $(AFS_CCRULE) $(srcdir)/pagsh.c 
 
-pagsh.krb: libsys.a pagsh.krb.o ${TOP_LIBDIR}/libauth.krb.a ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a
+pagsh.krb: libsys.a pagsh.krb.o ${TOP_LIBDIR}/libauth.krb.a ${TOP_LIBDIR}/librxkad.a
        $(AFS_LDRULE) pagsh.krb.o ${TOP_LIBDIR}/libauth.krb.a \
-               ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a ${LIBS} $(LIB_roken)
+               ${TOP_LIBDIR}/librxkad.a ${LIBS} $(LIB_roken)
 
 #
 # Test programs.
index cc1ea811dd8902e68a69a39c07e207d12769097a..003f3789fe246f795cdd2c94f8dbddb9c645b2a9 100644 (file)
@@ -30,7 +30,6 @@ INCLS=\
        ${TOP_INCDIR}/lock.h \
        ${TOP_INCDIR}/ubik.h \
        ${TOP_INCDIR}/lwp.h \
-       ${TOP_INCDIR}/des.h \
        ${TOP_INCDIR}/rx/rx.h \
        ${TOP_INCDIR}/rx/xdr.h \
        ${TOP_INCDIR}/rx/rxkad.h \
@@ -153,7 +152,8 @@ server.o: ${BUDB}/server.c budb_errs.h ${INCLS}
        $(AFS_CCRULE) $(BUDB)/server.c
 
 budb_server: $(SERVER_OBJS) ${LIBS}
-       $(AFS_LDRULE) $(SERVER_OBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) $(SERVER_OBJS) ${LIBS} \
+               $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 budb.cs.c: ${BUDB}/budb.rg
        ${RXGEN} -u -C -o $@ ${srcdir}/${BUDB}/budb.rg
index 5c5db2bb27356196e2f03fd7b0406fe81d604bce..94fff9329cc5c5aa63516808ebcd77bdcb9106bb 100644 (file)
@@ -72,7 +72,7 @@ all: butc
 
 butc: ${BUTCOBJS} ${BUTCLIBS}
        $(AFS_LDRULE) ${BUTCOBJS} ${BUTCLIBS} \
-               $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 libbutm.a: ${BUTMOBJS} AFS_component_version_number.o
        -$(RM) -f libbutm.a
index 560eff22e175d6219e857feb90c0cb5fcb6cda06..5f71aac471a9a860b723085024544634eefaeed9 100644 (file)
@@ -83,8 +83,8 @@ BUTCLIBS=$(DESTDIR)\lib\afs\afsbudb.lib  \
 !ELSE
        $(DESTDIR)\lib\afspthread.lib \
 !ENDIF
-            $(DESTDIR)\lib\afsdes.lib \
             $(DESTDIR)\lib\libafsconf.lib \
+            $(DESTDIR)\lib\afshcrypto.lib \
             $(DESTDIR)\lib\afsroken.lib
 
 
index 623315c3ea6638277034814ff74b9228c70baae8..0871a6558d9e52ab24983530adc4a96017bf8423 100644 (file)
@@ -150,7 +150,8 @@ display.o: ${PTSERVER}/display.c ${INCLS}
 
 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${TOP_LIBDIR}/libaudit.a map.o
        $(AFS_LDRULE) ptserver.o ptutils.o ptprocs.o \
-               ptint.ss.o ptint.xdr.o utils.o map.o $(LIBS) ${MT_LIBS} \
+               ptint.ss.o ptint.xdr.o utils.o map.o \
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} \
                ${XLIBS} ${TOP_LIBDIR}/libaudit.a
 
 db_verify.o: ${PTSERVER}/db_verify.c ${INCLS}
@@ -158,12 +159,12 @@ db_verify.o: ${PTSERVER}/db_verify.c ${INCLS}
 
 db_verify: db_verify.o pterror.o display.o $(LIBS)
        $(AFS_LDRULE) db_verify.o display.o pterror.o \
-               $(LIBS) ${MT_LIBS} ${XLIBS}
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 ptclient: ptclient.o display.o ptuser.o pterror.o ptint.cs.o ptint.xdr.o \
        AFS_component_version_number.o $(LIBS)
        $(AFS_LDRULE) ptclient.o display.o $(PTOBJS) \
-               $(LIBS) ${MT_LIBS} ${XLIBS}
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 ptclient.o: ${PTSERVER}/ptclient.c ${INCLS}
        $(AFS_CCRULE) $(PTSERVER)/ptclient.c
@@ -176,34 +177,37 @@ pterror.h pterror.c: ${PTSERVER}/pterror.et
        ${COMPILE_ET} -p ${srcdir}/${PTSERVER} pterror
 
 pts: pts.o $(PTOBJS) ${TOP_LIBDIR}/libcmd.a $(LIBS) ${INCLS}
-       $(AFS_LDRULE) pts.o ${TOP_LIBDIR}/libcmd.a \
-               $(PTOBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) pts.o ${TOP_LIBDIR}/libcmd.a $(PTOBJS) \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 pts.o: ${PTSERVER}/pts.c
        $(AFS_CCRULE) $(PTSERVER)/pts.c
 
 readgroup: readgroup.o $(PTOBJS) $(LIBS)
-       $(AFS_LDRULE) readgroup.o $(PTOBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) readgroup.o $(PTOBJS) \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 readgroup.o: ${PTSERVER}/readgroup.c ${INCLS}
        $(AFS_CCRULE) $(PTSERVER)/readgroup.c
 
 readpwd: readpwd.o $(PTOBJS) $(LIBS)
-       $(AFS_LDRULE) readpwd.o $(PTOBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) readpwd.o $(PTOBJS) \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 readpwd.o: ${PTSERVER}/readpwd.c ${INCLS}
        $(AFS_CCRULE) $(PTSERVER)/readpwd.c
 
 testpt: testpt.o $(PTOBJS) ${TOP_LIBDIR}/libcmd.a $(LIBS)
-       $(AFS_LDRULE) testpt.o -lm ${TOP_LIBDIR}/libcmd.a \
-               $(PTOBJS) $(LIBS) ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) testpt.o -lm ${TOP_LIBDIR}/libcmd.a $(PTOBJS) \
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 testpt.o: ${PTSERVER}/testpt.c ${INCLS}
        $(AFS_CCRULE) $(PTSERVER)/testpt.c
 
 pt_util: pt_util.o ptutils.o ubik.o utils.o map.o $(PTOBJS) $(LIBS)
        $(AFS_LDRULE) pt_util.o ptutils.o ubik.o utils.o map.o $(PTOBJS) \
-               ${TOP_LIBDIR}/libcmd.a $(LIBS) ${MT_LIBS} ${XLIBS}
+               ${TOP_LIBDIR}/libcmd.a \
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 pt_util.o: ${PTSERVER}/pt_util.c
        $(AFS_CCRULE) $(PTSERVER)/pt_util.c
index d145231c12d3bd20a9ec6d8c80d40e79ae935357..c1f6f3620454a39d3e246ae327fd1105247ab129 100644 (file)
@@ -50,14 +50,18 @@ FSSDEBUG_OBJS = fssync-debug.o physio.o common.o ${UTILOBJS} ${VLIBOBJS} ${DIROB
 
 SSSDEBUG_OBJS = salvsync-debug.o physio.o common.o ${UTILOBJS} ${VLIBOBJS} ${DIROBJS} ${LWPOBJS}
 
-LIBS=${TOP_LIBDIR}/libafsauthent.a \
+LIBS=   ${TOP_LIBDIR}/libafsauthent.a \
        ${TOP_LIBDIR}/libafsrpc.a \
        ${TOP_LIBDIR}/util.a \
        ${TOP_LIBDIR}/libcmd.a
 
-SLIBS=${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libdir.a \
-       ${TOP_LIBDIR}/libvlib.a ${TOP_LIBDIR}/librx.a \
-       ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libacl.a \
+SLIBS= ${TOP_LIBDIR}/libcmd.a \
+       ${TOP_LIBDIR}/libdir.a \
+       ${TOP_LIBDIR}/libvlib.a \
+       ${TOP_LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/liblwp.a \
+       ${TOP_LIBDIR}/libsys.a \
+       ${TOP_LIBDIR}/libacl.a \
        ${TOP_LIBDIR}/util.a
 
 all: salvageserver dafssync-debug salvsync-debug dasalvager
@@ -177,7 +181,7 @@ namei_ops.o: ${VOL}/namei_ops.c
 
 salvageserver: ${OBJECTS} ${LIBS}
        $(AFS_LDRULE) ${OBJECTS} ${LIBS} \
-               $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               $(LIB_roken) $(LIB_hcrypto) $(LIB_crypt) ${MT_LIBS} ${XLIBS}
 
 dasalvager: ${SOBJECTS} ${SLIBS}
        $(AFS_LDRULE) ${SOBJECTS} ${SLIBS} \
@@ -185,11 +189,11 @@ dasalvager: ${SOBJECTS} ${SLIBS}
 
 dafssync-debug: ${FSSDEBUG_OBJS} ${LIBS}
        $(AFS_LDRULE) ${FSSDEBUG_OBJS} ${LIBS} \
-               $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               $(LIB_roken) $(LIB_hcrypto) $(LIB_crypt) ${MT_LIBS} ${XLIBS}
 
 salvsync-debug: ${SSSDEBUG_OBJS} ${LIBS}
        $(AFS_LDRULE) ${SSSDEBUG_OBJS} ${LIBS} \
-               $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               $(LIB_roken) $(LIB_hcrypto) $(LIB_crypt) ${MT_LIBS} ${XLIBS}
 
 install: salvageserver dafssync-debug salvsync-debug dasalvager
        ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
index 7b157c6f771d24772e1c9a05108a84c278eddf5b..45dd6e48cf6d49bf5c284e7cc2743297bb17a3b4 100644 (file)
@@ -22,7 +22,7 @@ AFSLIBS = \
                ${TOP_LIBDIR}/libauth.a \
                ${TOP_LIBDIR}/librxkad.a \
                ${TOP_LIBDIR}/libsys.a \
-               ${TOP_LIBDIR}/libdes.a \
+               ${TOP_LIBDIR}/libafshcrypto_lwp.a \
                ${TOP_LIBDIR}/librx.a \
                ${TOP_LIBDIR}/liblwp.a \
                ${TOP_LIBDIR}/libcmd.a \
@@ -37,7 +37,7 @@ KAFSLIBS = \
                ${TOP_LIBDIR}/libauth.krb.a \
                ${TOP_LIBDIR}/librxkad.a \
                ${TOP_LIBDIR}/libsys.a \
-               ${TOP_LIBDIR}/libdes.a \
+               ${TOP_LIBDIR}/libafshcrypto_lwp.a \
                ${TOP_LIBDIR}/librx.a \
                ${TOP_LIBDIR}/liblwp.a \
                ${TOP_LIBDIR}/libcmd.a \
index d5f6996d206c79db8d193bb794543bca9d6b193f..e98f24244de6db496e907fbd800668c96a40f35b 100644 (file)
@@ -100,14 +100,15 @@ pthread_glock.o: ${UTIL}/pthread_glock.c
 
 utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
        $(AFS_LDRULE) utst_server.o utst_int.ss.o utst_int.xdr.o \
-               libubik_pthread.a $(LIBS)
+               libubik_pthread.a $(LIBS) $(LIB_hcrypto) $(LIB_roken)
 
 utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
        $(AFS_LDRULE) utst_client.o utst_int.cs.o utst_int.xdr.o \
-               libubik_pthread.a $(LIBS)
+               libubik_pthread.a $(LIBS) $(LIB_hcrypto) $(LIB_roken)
 
 udebug: udebug.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
-       $(AFS_LDRULE) udebug.o libubik_pthread.a $(LIBS)
+       $(AFS_LDRULE) udebug.o libubik_pthread.a \
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken)
 
 ubik_int.cs.c: ${UBIK}/ubik_int.xg
        ${RXGEN} -A -x -C -o $@ ${UBIK}/ubik_int.xg
index 1067f31dfaa805b404536e9717384eb37d3e7dff..1b07f8fc947ab0cd53cd9a64c2afc997cf4cccc5 100644 (file)
@@ -52,7 +52,9 @@ RXOBJS = rx_pthread.o
 objects= ${VICEDOBJS} ${VLSERVEROBJS} ${LWPOBJS} ${LIBACLOBJS} \
         ${UTILOBJS} ${DIROBJS} ${VOLOBJS} ${FSINTOBJS} ${RXOBJS}
 
-LIBS=${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/util.a
+LIBS=${TOP_LIBDIR}/libafsauthent.a \
+     ${TOP_LIBDIR}/libafsrpc.a \
+     ${TOP_LIBDIR}/util.a
 
 all: fileserver
 
@@ -206,7 +208,8 @@ afsint.xdr.o: ../fsint/afsint.xdr.c
        $(AFS_CCRULE) ../fsint/afsint.xdr.c
 
 fileserver: ${objects} ${LIBS}
-       $(AFS_LDRULE) ${objects} ${LIBS} $(LIB_roken) ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) ${objects} \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
        
 install: fileserver
        ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
index e7f5f24344533486e9e408f28ee7d79bb4f3186e..362cd38d96712474deec387724b8634085279091 100644 (file)
@@ -108,26 +108,29 @@ get_krbrlm.o: ${UTIL}/get_krbrlm.c
 
 vldb_check: vldb_check.o ${LIBS} AFS_component_version_number.o
        $(AFS_LDRULE) vldb_check.o AFS_component_version_number.o \
-               ${LIBS} ${MT_LIBS} ${XLIBS} 
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS} 
 
 vldb_check.o: ${VLSERVER}/vldb_check.c 
        $(AFS_CCRULE) $(VLSERVER)/vldb_check.c
 
 cnvldb: cnvldb.o ${LIBS} 
-       $(AFS_LDRULE) cnvldb.o ${LIBS} ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) cnvldb.o \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 cnvldb.o: ${VLSERVER}/cnvldb.c
        $(AFS_CCRULE) $(VLSERVER)/cnvldb.c
 
 sascnvldb: sascnvldb.o ${LIBS} 
-       $(AFS_LDRULE) sascnvldb.o ${LIBS} ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) sascnvldb.o \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 sascnvldb.o: ${VLSERVER}/sascnvldb.c
        $(AFS_CCRULE) $(VLSERVER)/sascnvldb.c
 
 vlserver: vlserver.o vlutils.o vlprocs.o vldbint.ss.o vldbint.xdr.o $(LIBS)
        $(AFS_LDRULE) vlserver.o vlutils.o vlprocs.o vldbint.ss.o \
-               vldbint.xdr.o $(LIBS) ${MT_LIBS} ${XLIBS} \
+               vldbint.xdr.o \
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS} \
                ${TOP_LIBDIR}/libaudit.a
 
 vlserver.o: ${VLSERVER}/vlserver.c ${INCLS} AFS_component_version_number.o
@@ -166,9 +169,9 @@ Kvldbint.xdr.c: ${VLSERVER}/vldbint.xg
        ${RXGEN} -A -x -k -c -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
 
 vlclient: vlclient.o $(OBJS) $(LIBS) ${INCLS}
-       $(AFS_LDRULE) vlclient.o $(OBJS) $(LIBS) ${MT_LIBS} ${XLIBS} \
-               ${TOP_LIBDIR}/libcmd.a
-
+       $(AFS_LDRULE) vlclient.o $(OBJS) ${TOP_LIBDIR}/libcmd.a \
+               $(LIBS) $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               
 vlclient.o: ${VLSERVER}/vlclient.c
        $(AFS_CCRULE) $(VLSERVER)/vlclient.c
 
index bf5fecfb437f66bd05284ca8e4ad14d6b69e864a..4cb1d03682941afb84ecf5aa198fd70624cd0aa0 100644 (file)
@@ -217,10 +217,11 @@ vos.o: ${VOLSER}/vos.c
 vos: vos.o  ${VOSOBJS} ${VLSERVEROBJS} ${LIBS} ${TOP_LIBDIR}/libubik_pthread.a
        $(AFS_LDRULE) vos.o ${VOSOBJS} ${VLSERVEROBJS} ${LIBS} \
                ${TOP_LIBDIR}/libubik_pthread.a \
-               $(LIB_roken) ${MT_LIBS} ${XLIBS}
+               $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 volserver: ${objects} ${LIBS}
-       $(AFS_LDRULE) ${objects} ${LIBS} $(LIB_roken) ${MT_LIBS} ${XLIBS}
+       $(AFS_LDRULE) ${objects} \
+               ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
 
 install: volserver
        ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
index 28f0b53635419810cee57c3317e2d18cffba6b11..cd9906e32f2c39583d1a5f47b9e50a8d150b380a 100644 (file)
@@ -94,6 +94,7 @@ VOLSERVER_EXELIBS = \
        $(DESTDIR)\lib\afs\afseventlog.lib \
        $(DESTDIR)\lib\afs\mtafsutil.lib \
        $(DESTDIR)\lib\afspthread.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(VOLSERVER_EXEFILE): $(VOLSERVER_EXEOBJS) $(VOLSERVER_EXELIBS) 
index 75d746d2e47063fbd04ddf75bbf19532ea4ed3ad..eb2cd94b706387e470f403b89b3c379577a558bd 100644 (file)
@@ -16,12 +16,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 LIBS=${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libsys.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
        ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/util.a
 
 all: upserver upclient
index 9cd5b625a87de6b4b7504b3585c0e65f1a02e1dd..a1529ed7722adf38fd8ae6424d96e8fd627eeb4d 100644 (file)
@@ -16,7 +16,6 @@ LIBS = \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\afslwp.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
@@ -24,6 +23,7 @@ LIBS = \
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 ############################################################################
index 44ffaa4c2c16de309960e0a363fecfed5c2e0c47..f21253187daafdde40a528ce4f22d82ab8bd7138 100644 (file)
@@ -27,13 +27,13 @@ LIBS=${TOP_LIBDIR}/libvolser.a \
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/librxkad.a \
        ${TOP_LIBDIR}/libsys.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/libsys.a \
        ${TOP_LIBDIR}/liblwp.a \
        ${TOP_LIBDIR}/libcmd.a \
-       ${TOP_LIBDIR}/libcom_err.a\
-       ${TOP_LIBDIR}/util.a
+       ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/util.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 OBJS =  uss_procs.o \
        uss_common.o \
@@ -45,8 +45,8 @@ OBJS =  uss_procs.o \
        lex.yy.o \
        y.tab.o 
 
-uss: uss.o ${OBJS} 
-       $(AFS_LDRULE) uss.o ${OBJS} ${LIBS} $(LIB_roken) $(XLIBS)
+uss: uss.o ${OBJS} $(LIBS)
+       $(AFS_LDRULE) uss.o ${OBJS} ${LIBS} $(LIB_roken) $(LIB_crypt) $(XLIBS)
 
 uss.o:  uss.c AFS_component_version_number.c
 
index d1acc8e0a9181752e0e2f06cd2b2d6e7143eebd0..dc05814bb84ca0f7fa12f40efb4ec874b7d21070 100644 (file)
@@ -27,11 +27,11 @@ FSLIBS=${TOP_LIBDIR}/libsys.a \
         ${TOP_LIBDIR}/libcom_err.a \
         ${TOP_LIBDIR}/libcmd.a \
         ${TOP_LIBDIR}/libkauth.a \
-        ${TOP_LIBDIR}/libdes.a \
         ${TOP_LIBDIR}/librx.a \
         ${TOP_LIBDIR}/libsys.a \
         ${TOP_LIBDIR}/liblwp.a \
         ${TOP_LIBDIR}/libaudit.a \
+        ${TOP_LIBDIR}/libafshcrypto_lwp.a \
         $(TOP_LIBDIR)/libafsutil.a
 
 CMLIBS=${TOP_LIBDIR}/libsys.a \
index 22ff32df64fc191945ce87a1d95304de3744c90e..f0690c60a0c658a1f14f32f32fc3fb01eb21aa94 100644 (file)
 #endif
 #include <afs/errors.h>
 #include <afs/sys_prototypes.h>
-#include <des_prototypes.h>
 #include <rx/rx_prototypes.h>
-#include "../rxkad/md5.h"
+#include <hcrypto/md5.h>
+
 #ifdef O_LARGEFILE
 #define afs_stat        stat64
 #define afs_fstat       fstat64
index 9856511d6c1eddfbba6c7afc8fd3e1952fca9912..ce3f151860178addf12ad31fba7dca39e2c620bb 100644 (file)
@@ -17,7 +17,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 INCDIRS= -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -I..
 LDIRS= -L${TOP_LIBDIR} -L..
-LIBS= -lsys -lubik -lvldb -lauth -lrxkad -ldes -lcom_err -lcmd -lrx -llwp -lafsutil
+LIBS= -lsys -lubik -lvldb -lauth -lrxkad -lafshcrypto_lwp \
+      -lcom_err -lcmd -lrx -llwp -lafsutil
 
 all test:  fulltest owntest idtest getinitparams
 
index 1020ede783e18b987e97556aedd948e449857a83..2172704731ac064a6491b3da6eb0a6d556535611 100644 (file)
@@ -32,10 +32,10 @@ LIBS=${TOP_LIBDIR}/libacl.a \
        ${TOP_LIBDIR}/librxstat.a       \
        ${TOP_LIBDIR}/librx.a           \
        ${TOP_LIBDIR}/libsys.a  \
-       ${TOP_LIBDIR}/libdes.a          \
        ${TOP_LIBDIR}/libcom_err.a      \
        ${TOP_LIBDIR}/liblwp.a \
-       ${TOP_LIBDIR}/libafsutil.a
+       ${TOP_LIBDIR}/libafsutil.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
 
 headers=${TOP_INCDIR}/lwp.h            \
        ${TOP_INCDIR}/afs/acl.h \
index 7664159f8e656f7f6faa43182b1f780c2efc7ce5..78f16a47ae2364b637b076894b0f9c48d110c127 100644 (file)
@@ -51,7 +51,6 @@ EXELIBS = \
        $(DESTDIR)\lib/afs/afscom_err.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afs\afsint.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afslwp.lib \
@@ -60,6 +59,7 @@ EXELIBS = \
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(EXEFILE): $(EXEOBJS) $(EXERES) $(EXELIBS)
index 5628243a7092c9df0776174645dff6096a87ac81..bd47feca7daf5fdb0b8d643d7c9552567fa39803 100644 (file)
@@ -31,11 +31,11 @@ LIBS=\
        ${TOP_LIBDIR}/librxstat.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/libsys.a \
-       ${TOP_LIBDIR}/libafsutil.a
+       ${TOP_LIBDIR}/libafsutil.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a
 
 OBJS=vldbint.xdr.o vldbint.cs.o vl_errors.o
 
index f3d92fba7cba1cfa50ab74fa4784da4b6df2cd57..70e7687d4e5d6986f9ebf0f352eb10c9b51fc996 100644 (file)
@@ -81,7 +81,6 @@ VLSERVER_EXECLIBS = \
        $(DESTDIR)\lib\afsrxstat.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afslwp.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afs\afscom_err.lib \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsaudit.lib \
@@ -90,6 +89,7 @@ VLSERVER_EXECLIBS = \
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib
 
 $(VLSERVER): $(VLSERVER_EXEOBJS) $(LIBFILE) $(VLSERVER_EXECLIBS)
index f4b8124dd616b79cae6212f448ceb3d6d79b6cd0..a52501acfef169d5a62b26b1ca222a84d722aa3c 100644 (file)
@@ -36,7 +36,6 @@ LIBS=\
        ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/libcmd.a \
        ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/librxstat.a \
        ${TOP_LIBDIR}/librx.a \
        ${TOP_LIBDIR}/liblwp.a \
@@ -44,6 +43,7 @@ LIBS=\
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/libkauth.a \
        ${TOP_LIBDIR}/libusd.a \
+       ${TOP_LIBDIR}/libafshcrypto_lwp.a \
        ${TOP_LIBDIR}/util.a
 
 VOLDUMP_LIBS = \
index d1b613b73bc7b1cac240feeab602b1a0d8cd012e..7c42e0807a1c1f276ec3230eab0e3d9c0ce052c1 100644 (file)
@@ -66,7 +66,6 @@ EXEC_LIBS = \
        $(DESTDIR)\lib\afs\afsusd.lib \
        $(DESTDIR)\lib\afsrxkad.lib \
        $(DESTDIR)\lib\afsrxstat.lib \
-       $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afslwp.lib \
        $(DESTDIR)\lib\afs\afsacl.lib \
@@ -74,6 +73,7 @@ EXEC_LIBS = \
        $(DESTDIR)\lib\afs\afseventlog.lib \
        $(DESTDIR)\lib\libafsconf.lib \
         $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\afshcrypto.lib \
        $(DESTDIR)\lib\afsroken.lib