Changeset 481


Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (5 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

Location:
trunk
Files:
17 added
14 deleted
120 edited

Legend:

Unmodified
Added
Removed
  • trunk/Install.sh

    r112 r481  
    279279fi
    280280
    281 #------------------------------------------------------------
    282 #
    283 #  Kernel module
    284 #
    285 #------------------------------------------------------------
    286 
    287 KCHECK="no"
    288 
    289 if [ "x$I386_LINUX" = "xyes" ]; then
    290 
    291 $dialog \
    292 --title "Kernel module rootkit detection" \
    293 --backtitle "Samhain $VERSION" \
    294 --inputbox "SAMHAIN can detect kernel module rootkits if compiled with support\nfor this. If you want to enable this option, please give the path\nto your System.map file, else choose CANCEL.\n\nNOTE: this option will require root privileges for at least one\ncommand during compilation (to read from /dev/kmem)." \
    295 16 75 "/boot/System.map" \
    296 2> $tmp
    297 
    298 
    299 mtest=$?
    300 
    301 if [ $mtest = -1 ]; then
    302     exit 1
    303 fi
    304 if [ $mtest = 0 ]; then
    305     mfile=`cat $tmp`
    306     for z in $mfile ; do
    307         cfgline="$cfgline --with-kcheck=$z"
    308     done
    309     KCHECK="yes"
    310 fi
    311 
    312 fi
    313281
    314282#------------------------------------------------------------
  • trunk/Makefile.in

    r461 r481  
    7474SAMHAIN  = @sh_main_prg@
    7575YULECTL  = @yulectl_prg@
     76SADMIN   = @samhainadmin_prg@
    7677XOR_CODE = @xor_code@
    77 SH_LKM   = @sh_lkm@
    7878TIGER_SRC = @tiger_src@
    7979
     
    116116        sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h \
    117117        sh_mail.h sh_mail_int.h sh_nmail.h sh_filter.h \
    118         sh_mem.h sh_entropy.h sh_forward.h sh_modules.h sh_utmp.h \
    119         sh_kern.h sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
     118        sh_mem.h sh_entropy.h sh_xfer.h sh_modules.h sh_utmp.h \
     119        sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
    120120        sh_gpg.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
    121121        sh_schedule.h bignum.h trustfile.h slib.h zAVLTree.h \
     
    126126        sh_log_check.h sh_log_evalrule.h sh_log_correlate.h \
    127127        sh_log_mark.h sh_log_repeat.h sh_inotify.h sh_registry.h sh_ipvx.h \
    128         sh_restrict.h sh_sub.h sh_fInotify.h sh_checksum.h
     128        sh_restrict.h sh_sub.h sh_fInotify.h sh_checksum.h \
     129        sh_dbIO.h sh_dbIO_int.h sh_guid.h sh_dbCheck.h sh_dbCreate.h \
     130        sh_sem.h
    129131
    130132
     
    137139        $(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c $(srcsrc)/sh_nmail.c \
    138140        $(srcsrc)/sh_mem.c $(srcsrc)/sh_entropy.c \
    139         $(srcsrc)/sh_forward.c $(srcsrc)/sh_modules.c \
    140         $(srcsrc)/sh_utmp.c $(srcsrc)/sh_login_track.c $(srcsrc)/sh_kern.c \
     141        $(srcsrc)/sh_xfer_client.c $(srcsrc)/sh_xfer_server.c \
     142        $(srcsrc)/sh_xfer_syslog.c $(srcsrc)/sh_modules.c \
     143        $(srcsrc)/sh_utmp.c $(srcsrc)/sh_login_track.c \
    141144        $(srcsrc)/sh_suidchk.c $(srcsrc)/sh_srp.c \
    142145        $(srcsrc)/sh_fifo.c $(srcsrc)/sh_tools.c \
     
    169172        $(srcsrc)/sh_audit.c $(srcsrc)/sh_registry.c \
    170173        $(srcsrc)/sh_ipvx.c $(srcsrc)/sh_restrict.c \
    171         $(srcsrc)/sh_filetype.c $(srcsrc)/sh_sub.c $(srcsrc)/sh_fInotify.c\
    172         $(srcsrc)/sh_checksum.c \
     174        $(srcsrc)/sh_filetype.c $(srcsrc)/sh_sub.c $(srcsrc)/sh_fInotify.c \
     175        $(srcsrc)/sh_checksum.c $(srcsrc)/sh_guid.c $(srcsrc)/sh_sem.c \
     176        $(srcsrc)/sh_dbIO.c $(srcsrc)/sh_dbCheck.c  $(srcsrc)/sh_dbCreate.c \
    173177        $(srcsrc)/t-test1.c
    174178
     
    177181        sh_getopt.o sh_readconf.o sh_filter.o \
    178182        sh_hash.o sh_mail.o sh_nmail.o sh_mem.o sh_login_track.o \
    179         sh_entropy.o sh_forward.o sh_modules.o sh_utmp.o sh_kern.o \
     183        sh_entropy.o sh_modules.o sh_utmp.o \
     184        sh_xfer_client.o sh_xfer_server.o sh_xfer_syslog.o \
    180185        sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_gpg.o \
    181186        sh_cat.o sh_calls.o sh_extern.o sh_database.o sh_err_log.o \
     
    191196        sh_pthread.o sh_string.o sh_inotify.o dnmalloc.o \
    192197        sh_audit.o sh_registry.o sh_ipvx.o sh_restrict.o \
    193         sh_filetype.o sh_sub.o sh_fInotify.o sh_checksum.o
    194 
    195 KERN = kern_head.h kern_head.c
     198        sh_filetype.o sh_sub.o sh_fInotify.o sh_checksum.o \
     199        sh_guid.o sh_sem.o sh_dbIO.o sh_dbCheck.o sh_dbCreate.o
     200
    196201
    197202TESTSUITE = test.sh testcompile.sh testhash.sh testtiger.txt \
     
    217222        src include man scripts init docs sql_init test dsys
    218223
    219 PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
     224PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) $(SADMIN)
    220225
    221226#----------------------------------------------------------
     
    225230#----------------------------------------------------------
    226231
    227 all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) @sh_lkm@ sstrip
     232all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) sstrip
    228233
    229234
     
    281286        if test -f depend-gen; then \
    282287          failfiles=""; \
    283           for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
     288          for ff in $(SOURCES); do \
    284289            ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/depend.dep $$ff || \
    285290                failfiles="$${failfiles} $$ff"; \
     
    320325        if test -f depend-gen; then \
    321326          failfiles=""; \
    322           for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
     327          for ff in $(SOURCES); do \
    323328             ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff || \
    324329                failfiles="$${failfiles} $$ff"; \
     
    339344depend: depend-gen
    340345        @echo "update Makefile.in ..."; \
    341         for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
     346        for ff in $(SOURCES); do \
    342347          ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff; \
    343348          echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
     
    355360#
    356361
    357 CLEANFILES = encode config_xor.h depend-gen sh_ks.h sh_ks_xor.h kern_head \
     362CLEANFILES = encode config_xor.h depend-gen \
    358363        internal.h sh_MK.h trustfile sstrip samhain mkhdr encode cutest \
    359         yule samhain_setpwd samhain_stealth samhainrc yulectl \
    360         samhain_hide.ko samhain_kmem.ko
     364        yule samhain_setpwd samhain_stealth samhainrc yulectl
    361365
    362366clean:
     
    374378        init/samhain.startIRIX init/samhain.startMACOSX \
    375379        deploy.sh sh_MK.h samhain-install.sh sh_gpg_chksum.h sh_gpg_fp.h \
    376         rules.deb rules.deb-light \
     380        rules.deb rules.deb-light src/CuTestMain.c \
    377381        scripts/samhainadmin.pl scripts/check_samhain.pl \
    378         scripts/samhain.ebuild scripts/samhain.ebuild-light
     382        scripts/samhain.ebuild scripts/samhain.ebuild-light \
     383        scripts/yuleadmin.pl scripts/logrotate \
     384        scripts/redhat_i386.client.spec scripts/samhain.spec hp_ux.psf
    379385
    380386TESTCLEANFILES = samhain.build samhain.new yule.html \
     
    464470#----------------------------------------------------------
    465471
    466 install: install-lkm install-program install-man install-data
     472install: install-program install-man install-data
    467473        @echo; \
    468474        echo "  You can use 'samhain-install.sh uninstall' for uninstalling"; \
     
    472478        echo
    473479
    474 install-light: install-lkm install-program install-data
     480install-light: install-program install-data
    475481        @echo; \
    476482        echo "  You can use 'samhain-install.sh uninstall' for uninstalling"; \
     
    480486        echo
    481487
    482 purge: uninstall-lkm uninstall-program uninstall-man
     488purge: uninstall-program uninstall-man
    483489        @echo "./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data"; \
    484490        ./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data
     
    486492remove: uninstall
    487493
    488 uninstall: uninstall-lkm uninstall-program uninstall-man uninstall-data
     494uninstall: uninstall-program uninstall-man uninstall-data
    489495        @echo; \
    490496        echo "  Use 'make purge' if you also want to uninstall the configuration file"; \
     
    505511# --- program  ---
    506512#
    507 
    508 # -- NEW --
    509 install-lkm: @sh_lkm@
    510         @RVER=`uname -r`; \
    511         if test "x@sh_lkm@" != "x"; then \
    512           if test -d /lib/modules/$$RVER; then \
    513             MODDIR="/lib/modules/$$RVER"; \
    514           elif test -d /lib/modules/misc; then \
    515             MODDIR="/lib/modules/misc"; \
    516           elif test -d /lib/modules; then \
    517             MODDIR="/lib/modules/misc"; \
    518           fi; \
    519           $(mkinstalldirs) $(DESTDIR)$${MODDIR}; \
    520           list='@sh_lkm@'; for p in $$list; do \
    521             echo " cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`"; \
    522             cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'` ; \
    523             chown root $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`; \
    524           done; \
    525           if test "x$(DESTDIR)" = x; then \
    526             echo " depmod -a || /sbin/depmod -a"; \
    527             depmod -a || /sbin/depmod -a; \
    528           fi; \
    529         fi
    530 
    531 uninstall-lkm:
    532         @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm";\
    533         ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm
    534513
    535514
     
    541520        @list='$(PROGRAMS)'; for p in $$list; do \
    542521          if test -f $$p; then \
    543             echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
    544             $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
    545             chmod 0700 $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
    546             echo " ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
    547             ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
     522            target=$(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`; \
     523            extension=`echo $$target|sed 's%.*\.%%'`; \
     524            if test x$$extension = x; then \
     525              echo " $(INSTALL_PROGRAM) $$p $$target"; \
     526              $(INSTALL_PROGRAM) $$p $$target; \
     527              chmod 0700 $$target; \
     528              echo " ./sstrip $$target"; \
     529              ./sstrip $$target; \
     530            else \
     531              echo " $(INSTALL_SHELL) $$p $$target"; \
     532              $(INSTALL_SHELL) $$p $$target; \
     533              chmod 0700 $$target; \
     534            fi; \
    548535          else :; fi; \
    549536        done
     
    709696        echo  "./mkinstalldirs @mydataroot@ || exit 1"  >> $$STAGE/setup.sh; \
    710697        echo  "chmod 700       @mydataroot@ || exit 1"  >> $$STAGE/setup.sh; \
    711         if test -f $$STAGE/lib/modules; then \
    712           RVER=`uname -r`; \
    713           echo "chown root:root lib/modules/$$RVER/*" >> $$STAGE/setup.sh; \
    714           if test -d /lib/modules/$$RVER; then \
    715             echo "./mkinstalldirs /lib/modules/$$RVER" >> $$STAGE/setup.sh; \
    716             echo  "cp -p lib/modules/$$RVER/* /lib/modules/$$RVER/" >> $$STAGE/setup.sh; \
    717           elif test -d /lib/modules/misc; then \
    718             echo "./mkinstalldirs /lib/modules/misc"   >> $$STAGE/setup.sh; \
    719             echo  "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
    720           elif test -d /lib/modules; then \
    721             echo "./mkinstalldirs /lib/modules/misc"   >> $$STAGE/setup.sh; \
    722             echo  "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
    723           fi; \
    724           echo "/sbin/depmod -a" >> $$STAGE/setup.sh; \
    725         fi; \
    726698        temp=`echo $(sbindir) | sed s,^/,,`; \
    727699        echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
     
    828800        echo $(mylogdir)    | sed s,^/,, >> debian/dirs; \
    829801        echo $(mylockdir)   | sed s,^/,, >> debian/dirs; \
    830         if test "x@sh_lkm@" != x; then \
    831           RVER=`uname -r`; \
    832           if test -d /lib/modules/$$RVER; then \
    833             echo "lib/modules/$$RVER"    >> debian/dirs; \
    834           elif test -d /lib/modules/misc; then \
    835             echo "lib/modules/misc"      >> debian/dirs; \
    836           elif test -d /lib/modules; then \
    837             echo "lib/modules/misc"      >> debian/dirs; \
    838           fi; \
    839         fi; \
    840802        $(MAKE) deb-run
    841803
     
    857819        echo $(mandir)/man8 | sed s,^/,, >> debian/dirs; \
    858820        echo usr/share/doc/$(PACKAGE)    >> debian/dirs; \
    859         if test "x@sh_lkm@" != x; then \
    860           RVER=`uname -r`; \
    861           if test -d /lib/modules/$$RVER; then \
    862             echo "lib/modules/$$RVER"    >> debian/dirs; \
    863           elif test -d /lib/modules/misc; then \
    864             echo "lib/modules/misc"      >> debian/dirs; \
    865           elif test -d /lib/modules; then \
    866             echo "lib/modules/misc"      >> debian/dirs; \
    867           fi; \
    868         fi; \
    869821        echo $(top_srcdir)/README                         > debian/docs; \
    870822        echo $(top_srcdir)/test/testtiger.txt            >> debian/docs; \
     
    876828        echo $(top_srcdir)/docs/HOWTO-client+server.html >> debian/docs; \
    877829        echo $(top_srcdir)/docs/HOWTO-samhain+GnuPG.html >> debian/docs; \
    878         echo $(top_srcdir)/docs/MANUAL-2_3.html.tar      >> debian/docs; \
    879         echo $(top_srcdir)/docs/MANUAL-2_3.pdf           >> debian/docs; \
     830        echo $(top_srcdir)/docs/MANUAL-2_4.html.tar      >> debian/docs; \
     831        echo $(top_srcdir)/docs/MANUAL-2_4.pdf           >> debian/docs; \
    880832        echo $(top_srcdir)/docs/README.gcc_bug           >> debian/docs; \
    881833        echo $(top_srcdir)/docs/README.LZO               >> debian/docs; \
     
    11551107config_xor.h: config.h encode
    11561108        @echo 'encode $(XOR_CODE) config.h'; \
    1157         sleep 1; \
    11581109        ./encode $(XOR_CODE) config.h; \
    11591110        mv x_config.h  config_xor.h
    11601111
    1161 #.c.o:
    1162 #       @echo "./encode $(XOR_CODE) $<  -->  x_`echo $< |sed 's%.*/%%'`"; \
    1163 #       ./encode $(XOR_CODE) $<; \
    1164 #       echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`"; \
    1165 #       $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`; \
    1166 #       rm x_`echo $< |sed 's%.*/%%'`
    1167 
    1168 $(OBJECTS): encode internal.h
     1112
     1113$(OBJECTS): encode internal.h config_xor.h
    11691114        @echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
    11701115        ./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
     
    12451190        gdb ./cutest
    12461191
    1247 samhain_hide.o: $(srcsrc)/samhain_hide.c samhain_erase.o
    1248         gcc @lkm_inc@ -I. -Wall -O2  -c $(srcsrc)/samhain_hide.c
    1249 
    1250 samhain_erase.o: $(srcsrc)/samhain_erase.c
    1251         gcc @lkm_inc@ -I. -Wall -O2  -c $(srcsrc)/samhain_erase.c
    1252 
    1253 # -- NEW --
    1254 samhain_hide.ko: $(srcsrc)/samhain_hide.c
    1255         @test -d m_comp || mkdir m_comp; \
    1256         echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
    1257         echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
    1258         echo "obj-m   := samhain_hide.o"                   >> m_comp/Makefile;\
    1259         echo ".PHONY: modules install clean modules_add"   >> m_comp/Makefile;\
    1260         echo "install : modules_add"                       >> m_comp/Makefile;\
    1261         echo "modules modules_install clean:"              >> m_comp/Makefile;\
    1262         echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" |  tr T '\t' >> m_comp/Makefile;\
    1263         cp config.h m_comp/; \
    1264         cp $(srcsrc)/samhain_hide.c m_comp/; \
    1265         cd m_comp && $(MAKE) modules
    1266         @if test -f m_comp/samhain_hide.ko; then \
    1267           cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
    1268           rm -rf m_comp/; \
    1269         else \
    1270           echo "Kernel module samhain_hide.ko not build"; \
    1271           exit 1; \
    1272         fi
    1273 
    1274 # -- NEW --
    1275 samhain_kmem.ko: $(srcsrc)/samhain_kmem.c
    1276         @test -d m_comp || mkdir m_comp; \
    1277         echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
    1278         echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
    1279         echo "obj-m   := @install_name@_kmem.o"            >> m_comp/Makefile;\
    1280         echo ".PHONY: modules install clean modules_add"   >> m_comp/Makefile;\
    1281         echo "install : modules_add"                       >> m_comp/Makefile;\
    1282         echo "modules modules_install clean:"              >> m_comp/Makefile;\
    1283         echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" |  tr T '\t' >> m_comp/Makefile;\
    1284         cp config.h m_comp/; \
    1285         cp $(srcsrc)/samhain_kmem.c m_comp/@install_name@_kmem.c; \
    1286         cd m_comp && $(MAKE) modules
    1287         @if test -f m_comp/@install_name@_kmem.ko; then \
    1288           cp -p m_comp/@install_name@_kmem.ko samhain_kmem.ko; \
    1289           rm -rf m_comp/; \
    1290         else \
    1291           echo "Kernel module samhain_kmem.ko not build"; \
    1292           exit 1; \
    1293         fi
    1294 
    1295 
    1296 # -- NEW --
    1297 lkm: @sh_lkm@
    1298 
    1299 
    1300 
    1301 # For kernel syscall monitoring
    1302 kern_head: Makefile $(top_srcdir)/include/kern_head.h $(srcsrc)/kern_head.c
    1303         @echo "$(BUILD_CC) -I. -I./include -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)"; \
    1304         $(BUILD_CC) -I. -I./include -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)
    1305 
    1306 sh_ks.h: kern_head
    1307         @sleep 1; \
    1308         ./kern_head > sh_ks.h
    1309 
    1310 sh_ks_xor.h: encode sh_ks.h
    1311         @echo 'encode $(XOR_CODE) sh_ks.h'; \
    1312         sleep 1; \
    1313         ./encode $(XOR_CODE) sh_ks.h; \
    1314         mv x_sh_ks.h  sh_ks_xor.h
    13151192
    13161193# For bignum
     
    16651542        -rm -f $(top_srcdir)/scripts/*~
    16661543        (cd $(top_srcdir)/init && rm -f $(INITFILES))
    1667         (cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
    16681544        -rm -rf $(distdir)
    16691545        mkdir $(distdir)
    16701546        -chmod 777 $(distdir)
     1547        cp scripts/samhain.spec $(distdir)/samhain.spec; \
     1548        (cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
    16711549        @for file in $(DISTFILES); do \
    16721550          d=$(top_srcdir); \
     
    16751553          fi; \
    16761554        done; \
    1677         cp scripts/samhain.spec $(distdir)/samhain.spec; \
    16781555        rm -f $(distdir)/scripts/*.spec
    16791556
     
    17261603
    17271604
    1728 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h
    1729 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ignore.h
     1605samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h
     1606sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ignore.h
    17301607sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h
    1731 sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h
    1732 sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/CuTest.h
    1733 sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h
    1734 sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_forward.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h
     1608sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h
     1609sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/sh_dbIO.h $(srcinc)/CuTest.h
     1610sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbCheck.h $(srcinc)/sh_dbCreate.h $(srcinc)/sh_sem.h $(srcinc)/sh_extern.h
     1611sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_xfer.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/sh_socket.h
    17351612sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_checksum.h
    17361613sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h
     
    17381615sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h
    17391616sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h
    1740 sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h
     1617sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_hash.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h
    17411618sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/sh_nmail.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h
    17421619sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h
    17431620sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h
    17441621sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h
    1745 sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h
     1622sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h
    17461623sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h
    17471624sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h
    1748 sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h
     1625sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h
    17491626sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h $(srcinc)/CuTest.h
    1750 sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h
     1627sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h $(srcinc)/CuTest.h
    17511628sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h
    1752 sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h
    1753 sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h
     1629sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_xfer.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h
     1630sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_gpg.h
    17541631sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h
    17551632sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_calls.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_sub.h $(srcinc)/sh_utils.h
     
    17571634sh_database.o: $(srcsrc)/sh_database.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
    17581635sh_err_log.o: $(srcsrc)/sh_err_log.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h
    1759 sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
     1636sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_sem.h
    17601637sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h
    1761 sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h
     1638sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_schedule.h
    17621639bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h
    17631640mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h
     
    17721649minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h
    17731650slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h
    1774 rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h
     1651rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h
    17751652rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h
    17761653zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h
    1777 sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h
     1654sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_guid.h $(srcinc)/sh_fifo.h $(srcinc)/sh_utils.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h $(srcinc)/CuTest.h
    17781655sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h
    17791656yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h
     
    18121689sh_filetype.o: $(srcsrc)/sh_filetype.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h
    18131690sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h
    1814 sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h
     1691sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h
    18151692sh_checksum.o: $(srcsrc)/sh_checksum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_checksum.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h
     1693sh_guid.o: $(srcsrc)/sh_guid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h
     1694sh_dbIO.o: $(srcsrc)/sh_dbIO.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_gpg.h $(srcinc)/sh_tiger.h $(srcinc)/sh_xfer.h $(srcinc)/sh_pthread.h $(srcinc)/sh_socket.h $(srcinc)/sh_files.h $(srcinc)/zAVLTree.h
     1695sh_dbCheck.o: $(srcsrc)/sh_dbCheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h
     1696sh_dbCreate.o: $(srcsrc)/sh_dbCreate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h $(srcinc)/sh_guid.h
     1697sh_xfer_client.o: $(srcsrc)/sh_xfer_client.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h
     1698sh_xfer_server.o: $(srcsrc)/sh_xfer_server.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/sh_guid.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h
     1699sh_xfer_syslog.o: $(srcsrc)/sh_xfer_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h
     1700sh_xload_client.o: $(srcsrc)/sh_xload_client.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_guid.h
     1701sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h
  • trunk/acconfig.h

    r476 r481  
    375375/* Define if your vsnprintf is broken.        */
    376376#undef HAVE_BROKEN_VSNPRINTF
     377
     378/* Define if you have va_copy.                */
     379#undef VA_COPY
     380
     381/* Define if va_list may be copied as array.  */
     382#undef VA_COPY_AS_ARRAY
    377383
    378384/* Define if you need unix entropy gatherer.  */
  • trunk/aclocal.m4

    r476 r481  
    264264    AC_MSG_RESULT($sh_cv_typedef)
    265265    if test "$sh_cv_typedef" = yes; then
    266         AC_DEFINE($2)
     266        AC_DEFINE([$2], [1], [Define if type is defined in stdint.h or inttypes.h])
    267267        sh_$2=yes
    268268    else
     
    276276dnl *** va_copy checks ***
    277277dnl **********************
    278 # va_copy.m4 serial 1 (js-1.6.20070208)
    279 
    280 dnl ## From the OpenWrt Project (http://openwrt.org)
    281 dnl ## Project is GPL v2
    282 dnl ##
    283 dnl ##
    284 dnl ##  Check for C99 va_copy() implementation
    285 dnl ##  (and provide fallback implementation if neccessary)
    286 dnl ##
    287 dnl ##  configure.in:
    288 dnl ##    AC_CHECK_VA_COPY
    289 dnl ##  foo.c:
    290 dnl ##    #include "config.h"
    291 dnl ##    [...]
    292 dnl ##    va_copy(d,s)
    293 dnl ##
    294 dnl ##  This check is rather complex: first because we really have to
    295 dnl ##  try various possible implementations in sequence and second, we
    296 dnl ##  cannot define a macro in config.h with parameters directly.
    297 dnl ##
    298 
    299 dnl #   test program for va_copy() implementation
    300 changequote(<<,>>)
    301 m4_define(__va_copy_test, <<[
    302 #include <stdlib.h>
    303 #include <stdarg.h>
    304 #include <string.h>
    305 #define DO_VA_COPY(d, s) $1
    306 void test(char *str, ...)
    307 {
    308     va_list ap, ap2;
    309     int i;
    310     va_start(ap, str);
    311     DO_VA_COPY(ap2, ap);
    312     for (i = 1; i <= 9; i++) {
    313         int k = (int)va_arg(ap, int);
    314         if (k != i)
    315             abort();
    316     }
    317     DO_VA_COPY(ap, ap2);
    318     for (i = 1; i <= 9; i++) {
    319         int k = (int)va_arg(ap, int);
    320         if (k != i)
    321             abort();
    322     }
    323     va_end(ap);
    324 }
    325 int main(int argc, char *argv[])
    326 {
    327     test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9);
    328     exit(0);
    329 }
    330 ]>>)
    331 changequote([,])
    332 
    333 dnl #   test driver for va_copy() implementation
    334 m4_define(__va_copy_check, [
    335     AH_VERBATIM($1,
    336 [/* Predefined possible va_copy() implementation (id: $1) */
    337 #define __VA_COPY_USE_$1(d, s) $2])
    338     if test ".$ac_cv_va_copy" = .; then
    339         AC_TRY_RUN(__va_copy_test($2), [ac_cv_va_copy="$1"])
    340     fi
     278AC_DEFUN([SL_CHECK_VA_COPY],
     279[AC_MSG_CHECKING(for va_copy())
     280AC_CACHE_VAL(sh_cv_va_copy,[
     281        AC_TRY_RUN([
     282        #include <stdarg.h>
     283        void f (int i, ...) {
     284        va_list args1, args2;
     285        va_start (args1, i);
     286        va_copy (args2, args1);
     287        if (va_arg (args2, int) != 42)
     288          exit (1);
     289        if (va_arg (args1, int) != 42)
     290          exit (1);
     291        va_end (args1); va_end (args2);
     292        }
     293        int main() {
     294          f (0, 42);
     295          return 0;
     296        }],
     297        sh_cv_va_copy=yes
     298        ,
     299        sh_cv_va_copy=no
     300        ,
     301        sh_cv_va_copy=no)
    341302])
    342 
    343 dnl #   Autoconf check for va_copy() implementation checking
    344 AC_DEFUN([AC_CHECK_VA_COPY],[
    345   dnl #   provide Autoconf display check message
    346   AC_MSG_CHECKING(for va_copy() function)
    347   dnl #   check for various implementations in priorized sequence   
    348   AC_CACHE_VAL(ac_cv_va_copy, [
    349     ac_cv_va_copy=""
    350     dnl #   1. check for standardized C99 macro
    351     __va_copy_check(C99, [va_copy((d), (s))])
    352     dnl #   2. check for alternative/deprecated GCC macro
    353     __va_copy_check(GCM, [VA_COPY((d), (s))])
    354     dnl #   3. check for internal GCC macro (high-level define)
    355     __va_copy_check(GCH, [__va_copy((d), (s))])
    356     dnl #   4. check for internal GCC macro (built-in function)
    357     __va_copy_check(GCB, [__builtin_va_copy((d), (s))])
    358     dnl #   5. check for assignment approach (assuming va_list is a struct)
    359     __va_copy_check(ASS, [do { (d) = (s); } while (0)])
    360     dnl #   6. check for assignment approach (assuming va_list is a pointer)
    361     __va_copy_check(ASP, [do { *(d) = *(s); } while (0)])
    362     dnl #   7. check for memory copying approach (assuming va_list is a struct)
    363     __va_copy_check(CPS, [memcpy((void *)&(d), (void *)&(s)), sizeof((s))])
    364     dnl #   8. check for memory copying approach (assuming va_list is a pointer)
    365     __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s)), sizeof(*(s))])
    366     if test ".$ac_cv_va_copy" = .; then
    367         AC_ERROR([no working implementation found])
    368     fi
    369   ])
    370   dnl #   optionally activate the fallback implementation
    371   if test ".$ac_cv_va_copy" = ".C99"; then
    372       AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy() macro exists (and no fallback implementation is required)])
    373   fi
    374   dnl #   declare which fallback implementation to actually use
    375   AC_DEFINE_UNQUOTED([__VA_COPY_USE], [__VA_COPY_USE_$ac_cv_va_copy],
    376       [Define to id of used va_copy() implementation])
    377   dnl #   provide activation hook for fallback implementation
    378   AH_VERBATIM([__VA_COPY_ACTIVATION],
    379 [/* Optional va_copy() implementation activation */
    380 #ifndef HAVE_VA_COPY
    381 #define va_copy(d, s) __VA_COPY_USE(d, s)
    382 #endif
     303AC_MSG_RESULT($sh_cv_va_copy)
     304AC_MSG_CHECKING(for __va_copy())
     305AC_CACHE_VAL(sh_cv___va_copy,[
     306        AC_TRY_RUN([
     307        #include <stdarg.h>
     308        void f (int i, ...) {
     309        va_list args1, args2;
     310        va_start (args1, i);
     311        __va_copy (args2, args1);
     312        if (va_arg (args2, int) != 42)
     313          exit (1);
     314        if (va_arg (args1, int) != 42)
     315          exit (1);
     316        va_end (args1); va_end (args2);
     317        }
     318        int main() {
     319          f (0, 42);
     320          return 0;
     321        }],
     322        sh_cv___va_copy=yes
     323        ,
     324        sh_cv___va_copy=no
     325        ,
     326        sh_cv___va_copy=no)
    383327])
    384   dnl #   provide Autoconf display result message
    385   if test ".$ac_cv_va_copy" = ".C99"; then
    386       AC_MSG_RESULT([yes])
    387   else
    388       AC_MSG_RESULT([no (using fallback implementation)])
    389   fi
     328AC_MSG_RESULT($sh_cv___va_copy)
     329AC_MSG_CHECKING(whether va_lists can be copied by value)
     330AC_CACHE_VAL(sh_cv_va_val_copy,[
     331        AC_TRY_RUN([
     332        #include <stdarg.h>
     333        void f (int i, ...) {
     334        va_list args1, args2;
     335        va_start (args1, i);
     336        args2 = args1;
     337        if (va_arg (args2, int) != 42)
     338          exit (1);
     339        if (va_arg (args1, int) != 42)
     340          exit (1);
     341        va_end (args1); va_end (args2);
     342        }
     343        int main() {
     344          f (0, 42);
     345          return 0;
     346        }],
     347        sh_cv_va_val_copy=yes
     348        ,
     349        sh_cv_va_val_copy=no
     350        ,
     351        sh_cv_va_val_copy=no)
     352])
     353if test "x$sh_cv_va_copy" = "xyes"; then
     354  AC_DEFINE(VA_COPY, va_copy)
     355else if test "x$sh_cv___va_copy" = "xyes"; then
     356  AC_DEFINE(VA_COPY, __va_copy)
     357fi
     358fi
     359if test "x$sh_cv_va_val_copy" = "xno"; then
     360  AC_DEFINE(VA_COPY_AS_ARRAY)
     361fi
     362AC_MSG_RESULT($sh_cv_va_val_copy)
    390363])
    391364
  • trunk/config.guess

    r378 r481  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    5 #   Free Software Foundation, Inc.
    6 
    7 timestamp='2009-12-30'
     3#   Copyright 1992-2014 Free Software Foundation, Inc.
     4
     5timestamp='2014-03-23'
    86
    97# This file is free software; you can redistribute it and/or modify it
    108# under the terms of the GNU General Public License as published by
    11 # the Free Software Foundation; either version 2 of the License, or
     9# the Free Software Foundation; either version 3 of the License, or
    1210# (at your option) any later version.
    1311#
     
    1816#
    1917# You should have received a copy of the GNU General Public License
    20 # along with this program; if not, write to the Free Software
    21 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    22 # 02110-1301, USA.
     18# along with this program; if not, see <http://www.gnu.org/licenses/>.
    2319#
    2420# As a special exception to the GNU General Public License, if you
    2521# distribute this file as part of a program that contains a
    2622# configuration script generated by Autoconf, you may include it under
    27 # the same distribution terms that you use for the rest of that program.
    28 
    29 
    30 # Originally written by Per Bothner.  Please send patches (context
    31 # diff format) to <config-patches@gnu.org> and include a ChangeLog
    32 # entry.
     23# the same distribution terms that you use for the rest of that
     24# program.  This Exception is an additional permission under section 7
     25# of the GNU General Public License, version 3 ("GPLv3").
    3326#
    34 # This script attempts to guess a canonical system name similar to
    35 # config.sub.  If it succeeds, it prints the system name on stdout, and
    36 # exits with 0.  Otherwise, it exits with 1.
     27# Originally written by Per Bothner.
    3728#
    3829# You can get the latest version of this script from:
    3930# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     31#
     32# Please send patches with a ChangeLog entry to config-patches@gnu.org.
     33
    4034
    4135me=`echo "$0" | sed -e 's,.*/,,'`
     
    5751
    5852Originally written by Per Bothner.
    59 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    60 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
    61 Software Foundation, Inc.
     53Copyright 1992-2014 Free Software Foundation, Inc.
    6254
    6355This is free software; see the source for copying conditions.  There is NO
     
    141133UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    142134
     135case "${UNAME_SYSTEM}" in
     136Linux|GNU|GNU/*)
     137        # If the system lacks a compiler, then just pick glibc.
     138        # We could probably try harder.
     139        LIBC=gnu
     140
     141        eval $set_cc_for_build
     142        cat <<-EOF > $dummy.c
     143        #include <features.h>
     144        #if defined(__UCLIBC__)
     145        LIBC=uclibc
     146        #elif defined(__dietlibc__)
     147        LIBC=dietlibc
     148        #else
     149        LIBC=gnu
     150        #endif
     151        EOF
     152        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
     153        ;;
     154esac
     155
    143156# Note: order is significant - the case branches are not exclusive.
    144157
     
    146159    *:NetBSD:*:*)
    147160        # NetBSD (nbsd) targets should (where applicable) match one or
    148         # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
     161        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
    149162        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
    150163        # switched to ELF, *-*-netbsd* would select the old
     
    182195                ;;
    183196            *)
    184                 os=netbsd
     197                os=netbsd
    185198                ;;
    186199        esac
     
    203216        echo "${machine}-${os}${release}"
    204217        exit ;;
     218    *:Bitrig:*:*)
     219        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
     220        echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
     221        exit ;;
    205222    *:OpenBSD:*:*)
    206223        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
     
    225242                ;;
    226243        *5.*)
    227                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     244                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
    228245                ;;
    229246        esac
     
    271288        # 1.2 uses "1.2" for uname -r.
    272289        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    273         exit ;;
     290        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
     291        exitcode=$?
     292        trap '' 0
     293        exit $exitcode ;;
    274294    Alpha\ *:Windows_NT*:*)
    275295        # How do we know it's Interix rather than the generic POSIX subsystem?
     
    297317        exit ;;
    298318    *:OS400:*:*)
    299         echo powerpc-ibm-os400
     319        echo powerpc-ibm-os400
    300320        exit ;;
    301321    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    302322        echo arm-acorn-riscix${UNAME_RELEASE}
    303323        exit ;;
    304     arm:riscos:*:*|arm:RISCOS:*:*)
     324    arm*:riscos:*:*|arm*:RISCOS:*:*)
    305325        echo arm-unknown-riscos
    306326        exit ;;
     
    396416    # be no problem.
    397417    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    398         echo m68k-atari-mint${UNAME_RELEASE}
     418        echo m68k-atari-mint${UNAME_RELEASE}
    399419        exit ;;
    400420    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    401421        echo m68k-atari-mint${UNAME_RELEASE}
    402         exit ;;
     422        exit ;;
    403423    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    404         echo m68k-atari-mint${UNAME_RELEASE}
     424        echo m68k-atari-mint${UNAME_RELEASE}
    405425        exit ;;
    406426    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    407         echo m68k-milan-mint${UNAME_RELEASE}
    408         exit ;;
     427        echo m68k-milan-mint${UNAME_RELEASE}
     428        exit ;;
    409429    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    410         echo m68k-hades-mint${UNAME_RELEASE}
    411         exit ;;
     430        echo m68k-hades-mint${UNAME_RELEASE}
     431        exit ;;
    412432    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    413         echo m68k-unknown-mint${UNAME_RELEASE}
    414         exit ;;
     433        echo m68k-unknown-mint${UNAME_RELEASE}
     434        exit ;;
    415435    m68k:machten:*:*)
    416436        echo m68k-apple-machten${UNAME_RELEASE}
     
    482502        exit ;;
    483503    AViiON:dgux:*:*)
    484         # DG/UX returns AViiON for all architectures
    485         UNAME_PROCESSOR=`/usr/bin/uname -p`
     504        # DG/UX returns AViiON for all architectures
     505        UNAME_PROCESSOR=`/usr/bin/uname -p`
    486506        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
    487507        then
     
    496516            echo i586-dg-dgux${UNAME_RELEASE}
    497517        fi
    498         exit ;;
     518        exit ;;
    499519    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    500520        echo m88k-dolphin-sysv3
     
    553573        fi
    554574        exit ;;
    555     *:AIX:*:[456])
     575    *:AIX:*:[4567])
    556576        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    557577        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
     
    596616                if [ -x /usr/bin/getconf ]; then
    597617                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    598                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    599                     case "${sc_cpu_version}" in
    600                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
    601                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
    602                       532)                      # CPU_PA_RISC2_0
    603                         case "${sc_kernel_bits}" in
    604                           32) HP_ARCH="hppa2.0n" ;;
    605                           64) HP_ARCH="hppa2.0w" ;;
     618                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
     619                    case "${sc_cpu_version}" in
     620                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
     621                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     622                      532)                      # CPU_PA_RISC2_0
     623                        case "${sc_kernel_bits}" in
     624                          32) HP_ARCH="hppa2.0n" ;;
     625                          64) HP_ARCH="hppa2.0w" ;;
    606626                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
    607                         esac ;;
    608                     esac
     627                        esac ;;
     628                    esac
    609629                fi
    610630                if [ "${HP_ARCH}" = "" ]; then
    611631                    eval $set_cc_for_build
    612                     sed 's/^              //' << EOF >$dummy.c
    613 
    614               #define _HPUX_SOURCE
    615               #include <stdlib.h>
    616               #include <unistd.h>
    617 
    618               int main ()
    619               {
    620               #if defined(_SC_KERNEL_BITS)
    621                   long bits = sysconf(_SC_KERNEL_BITS);
    622               #endif
    623                   long cpu  = sysconf (_SC_CPU_VERSION);
    624 
    625                   switch (cpu)
    626                 {
    627                 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
    628                 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
    629                 case CPU_PA_RISC2_0:
    630               #if defined(_SC_KERNEL_BITS)
    631                     switch (bits)
    632                         {
    633                         case 64: puts ("hppa2.0w"); break;
    634                         case 32: puts ("hppa2.0n"); break;
    635                         default: puts ("hppa2.0"); break;
    636                         } break;
    637               #else  /* !defined(_SC_KERNEL_BITS) */
    638                     puts ("hppa2.0"); break;
    639               #endif
    640                 default: puts ("hppa1.0"); break;
    641                 }
    642                   exit (0);
    643               }
     632                    sed 's/^            //' << EOF >$dummy.c
     633
     634                #define _HPUX_SOURCE
     635                #include <stdlib.h>
     636                #include <unistd.h>
     637
     638                int main ()
     639                {
     640                #if defined(_SC_KERNEL_BITS)
     641                    long bits = sysconf(_SC_KERNEL_BITS);
     642                #endif
     643                    long cpu  = sysconf (_SC_CPU_VERSION);
     644
     645                    switch (cpu)
     646                        {
     647                        case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
     648                        case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
     649                        case CPU_PA_RISC2_0:
     650                #if defined(_SC_KERNEL_BITS)
     651                            switch (bits)
     652                                {
     653                                case 64: puts ("hppa2.0w"); break;
     654                                case 32: puts ("hppa2.0n"); break;
     655                                default: puts ("hppa2.0"); break;
     656                                } break;
     657                #else  /* !defined(_SC_KERNEL_BITS) */
     658                            puts ("hppa2.0"); break;
     659                #endif
     660                        default: puts ("hppa1.0"); break;
     661                        }
     662                    exit (0);
     663                }
    644664EOF
    645665                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     
    732752    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    733753        echo c1-convex-bsd
    734         exit ;;
     754        exit ;;
    735755    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    736756        if getsysinfo -f scalar_acc
     
    738758        else echo c2-convex-bsd
    739759        fi
    740         exit ;;
     760        exit ;;
    741761    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    742762        echo c34-convex-bsd
    743         exit ;;
     763        exit ;;
    744764    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    745765        echo c38-convex-bsd
    746         exit ;;
     766        exit ;;
    747767    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    748768        echo c4-convex-bsd
    749         exit ;;
     769        exit ;;
    750770    CRAY*Y-MP:*:*:*)
    751771        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     
    771791    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    772792        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    773         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    774         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    775         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    776         exit ;;
     793        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     794        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
     795        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     796        exit ;;
    777797    5000:UNIX_System_V:4.*:*)
    778         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    779         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
    780         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     798        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     799        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     800        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    781801        exit ;;
    782802    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
     
    790810        exit ;;
    791811    *:FreeBSD:*:*)
    792         case ${UNAME_MACHINE} in
    793             pc98)
    794                 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     812        UNAME_PROCESSOR=`/usr/bin/uname -p`
     813        case ${UNAME_PROCESSOR} in
    795814            amd64)
    796815                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
    797816            *)
    798                 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     817                echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
    799818        esac
    800819        exit ;;
     
    802821        echo ${UNAME_MACHINE}-pc-cygwin
    803822        exit ;;
     823    *:MINGW64*:*)
     824        echo ${UNAME_MACHINE}-pc-mingw64
     825        exit ;;
    804826    *:MINGW*:*)
    805827        echo ${UNAME_MACHINE}-pc-mingw32
    806828        exit ;;
     829    *:MSYS*:*)
     830        echo ${UNAME_MACHINE}-pc-msys
     831        exit ;;
    807832    i*:windows32*:*)
    808         # uname -m includes "-pc" on this system.
    809         echo ${UNAME_MACHINE}-mingw32
     833        # uname -m includes "-pc" on this system.
     834        echo ${UNAME_MACHINE}-mingw32
    810835        exit ;;
    811836    i*:PW*:*)
     
    813838        exit ;;
    814839    *:Interix*:*)
    815         case ${UNAME_MACHINE} in
     840        case ${UNAME_MACHINE} in
    816841            x86)
    817842                echo i586-pc-interix${UNAME_RELEASE}
     
    850875    *:GNU:*:*)
    851876        # the GNU system
    852         echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     877        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    853878        exit ;;
    854879    *:GNU/*:*:*)
    855880        # other systems with GNU libc and userland
    856         echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     881        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
    857882        exit ;;
    858883    i*86:Minix:*:*)
    859884        echo ${UNAME_MACHINE}-pc-minix
     885        exit ;;
     886    aarch64:Linux:*:*)
     887        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     888        exit ;;
     889    aarch64_be:Linux:*:*)
     890        UNAME_MACHINE=aarch64_be
     891        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    860892        exit ;;
    861893    alpha:Linux:*:*)
     
    868900          EV67)  UNAME_MACHINE=alphaev67 ;;
    869901          EV68*) UNAME_MACHINE=alphaev68 ;;
    870         esac
     902        esac
    871903        objdump --private-headers /bin/sh | grep -q ld.so.1
    872         if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    873         echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     904        if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
     905        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     906        exit ;;
     907    arc:Linux:*:* | arceb:Linux:*:*)
     908        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    874909        exit ;;
    875910    arm*:Linux:*:*)
     
    878913            | grep -q __ARM_EABI__
    879914        then
    880             echo ${UNAME_MACHINE}-unknown-linux-gnu
     915            echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    881916        else
    882             echo ${UNAME_MACHINE}-unknown-linux-gnueabi
     917            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
     918                | grep -q __ARM_PCS_VFP
     919            then
     920                echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
     921            else
     922                echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
     923            fi
    883924        fi
    884925        exit ;;
    885926    avr32*:Linux:*:*)
    886         echo ${UNAME_MACHINE}-unknown-linux-gnu
     927        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    887928        exit ;;
    888929    cris:Linux:*:*)
    889         echo cris-axis-linux-gnu
     930        echo ${UNAME_MACHINE}-axis-linux-${LIBC}
    890931        exit ;;
    891932    crisv32:Linux:*:*)
    892         echo crisv32-axis-linux-gnu
     933        echo ${UNAME_MACHINE}-axis-linux-${LIBC}
    893934        exit ;;
    894935    frv:Linux:*:*)
    895         echo frv-unknown-linux-gnu
     936        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     937        exit ;;
     938    hexagon:Linux:*:*)
     939        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    896940        exit ;;
    897941    i*86:Linux:*:*)
    898         LIBC=gnu
    899         eval $set_cc_for_build
    900         sed 's/^        //' << EOF >$dummy.c
    901         #ifdef __dietlibc__
    902         LIBC=dietlibc
    903         #endif
    904 EOF
    905         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
    906         echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
     942        echo ${UNAME_MACHINE}-pc-linux-${LIBC}
    907943        exit ;;
    908944    ia64:Linux:*:*)
    909         echo ${UNAME_MACHINE}-unknown-linux-gnu
     945        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    910946        exit ;;
    911947    m32r*:Linux:*:*)
    912         echo ${UNAME_MACHINE}-unknown-linux-gnu
     948        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    913949        exit ;;
    914950    m68*:Linux:*:*)
    915         echo ${UNAME_MACHINE}-unknown-linux-gnu
     951        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    916952        exit ;;
    917953    mips:Linux:*:* | mips64:Linux:*:*)
     
    932968EOF
    933969        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
    934         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     970        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
    935971        ;;
    936     or32:Linux:*:*)
    937         echo or32-unknown-linux-gnu
     972    openrisc*:Linux:*:*)
     973        echo or1k-unknown-linux-${LIBC}
     974        exit ;;
     975    or32:Linux:*:* | or1k*:Linux:*:*)
     976        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    938977        exit ;;
    939978    padre:Linux:*:*)
    940         echo sparc-unknown-linux-gnu
     979        echo sparc-unknown-linux-${LIBC}
    941980        exit ;;
    942981    parisc64:Linux:*:* | hppa64:Linux:*:*)
    943         echo hppa64-unknown-linux-gnu
     982        echo hppa64-unknown-linux-${LIBC}
    944983        exit ;;
    945984    parisc:Linux:*:* | hppa:Linux:*:*)
    946985        # Look for CPU level
    947986        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    948           PA7*) echo hppa1.1-unknown-linux-gnu ;;
    949           PA8*) echo hppa2.0-unknown-linux-gnu ;;
    950           *)    echo hppa-unknown-linux-gnu ;;
     987          PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
     988          PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
     989          *)    echo hppa-unknown-linux-${LIBC} ;;
    951990        esac
    952991        exit ;;
    953992    ppc64:Linux:*:*)
    954         echo powerpc64-unknown-linux-gnu
     993        echo powerpc64-unknown-linux-${LIBC}
    955994        exit ;;
    956995    ppc:Linux:*:*)
    957         echo powerpc-unknown-linux-gnu
     996        echo powerpc-unknown-linux-${LIBC}
     997        exit ;;
     998    ppc64le:Linux:*:*)
     999        echo powerpc64le-unknown-linux-${LIBC}
     1000        exit ;;
     1001    ppcle:Linux:*:*)
     1002        echo powerpcle-unknown-linux-${LIBC}
    9581003        exit ;;
    9591004    s390:Linux:*:* | s390x:Linux:*:*)
    960         echo ${UNAME_MACHINE}-ibm-linux
     1005        echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
    9611006        exit ;;
    9621007    sh64*:Linux:*:*)
    963         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1008        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9641009        exit ;;
    9651010    sh*:Linux:*:*)
    966         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1011        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9671012        exit ;;
    9681013    sparc:Linux:*:* | sparc64:Linux:*:*)
    969         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1014        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1015        exit ;;
     1016    tile*:Linux:*:*)
     1017        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9701018        exit ;;
    9711019    vax:Linux:*:*)
    972         echo ${UNAME_MACHINE}-dec-linux-gnu
     1020        echo ${UNAME_MACHINE}-dec-linux-${LIBC}
    9731021        exit ;;
    9741022    x86_64:Linux:*:*)
    975         echo x86_64-unknown-linux-gnu
     1023        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9761024        exit ;;
    9771025    xtensa*:Linux:*:*)
    978         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1026        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9791027        exit ;;
    9801028    i*86:DYNIX/ptx:4*:*)
     
    9851033        exit ;;
    9861034    i*86:UNIX_SV:4.2MP:2.*)
    987         # Unixware is an offshoot of SVR4, but it has its own version
    988         # number series starting with 2...
    989         # I am not positive that other SVR4 systems won't match this,
     1035        # Unixware is an offshoot of SVR4, but it has its own version
     1036        # number series starting with 2...
     1037        # I am not positive that other SVR4 systems won't match this,
    9901038        # I just have to hope.  -- rms.
    991         # Use sysv4.2uw... so that sysv4* matches it.
     1039        # Use sysv4.2uw... so that sysv4* matches it.
    9921040        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    9931041        exit ;;
     
    10211069        exit ;;
    10221070    i*86:*:5:[678]*)
    1023         # UnixWare 7.x, OpenUNIX and OpenServer 6.
     1071        # UnixWare 7.x, OpenUNIX and OpenServer 6.
    10241072        case `/bin/uname -X | grep "^Machine"` in
    10251073            *486*)           UNAME_MACHINE=i486 ;;
     
    10491097    pc:*:*:*)
    10501098        # Left here for compatibility:
    1051         # uname -m prints for DJGPP always 'pc', but it prints nothing about
    1052         # the processor, so we play safe by assuming i586.
     1099        # uname -m prints for DJGPP always 'pc', but it prints nothing about
     1100        # the processor, so we play safe by assuming i586.
    10531101        # Note: whatever this is, it MUST be the same as what config.sub
    10541102        # prints for the "djgpp" host, or else GDB configury will decide that
    10551103        # this is a cross-build.
    10561104        echo i586-pc-msdosdjgpp
    1057         exit ;;
     1105        exit ;;
    10581106    Intel:Mach:3*:*)
    10591107        echo i386-pc-mach3
     
    10901138          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    10911139    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    1092         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1093           && { echo i486-ncr-sysv4; exit; } ;;
     1140        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1141          && { echo i486-ncr-sysv4; exit; } ;;
    10941142    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
    10951143        OS_REL='.3'
     
    11341182        fi
    11351183        exit ;;
    1136     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    1137                       # says <Richard.M.Bartel@ccMail.Census.GOV>
    1138         echo i586-unisys-sysv4
    1139         exit ;;
     1184    PENTIUM:*:4.0*:*)   # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1185                        # says <Richard.M.Bartel@ccMail.Census.GOV>
     1186        echo i586-unisys-sysv4
     1187        exit ;;
    11401188    *:UNIX_System_V:4*:FTX*)
    11411189        # From Gerald Hewes <hewes@openmarket.com>.
     
    11631211    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    11641212        if [ -d /usr/nec ]; then
    1165                 echo mips-nec-sysv${UNAME_RELEASE}
     1213                echo mips-nec-sysv${UNAME_RELEASE}
    11661214        else
    1167                 echo mips-unknown-sysv${UNAME_RELEASE}
    1168         fi
    1169         exit ;;
     1215                echo mips-unknown-sysv${UNAME_RELEASE}
     1216        fi
     1217        exit ;;
    11701218    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
    11711219        echo powerpc-be-beos
     
    11801228        echo i586-pc-haiku
    11811229        exit ;;
     1230    x86_64:Haiku:*:*)
     1231        echo x86_64-unknown-haiku
     1232        exit ;;
    11821233    SX-4:SUPER-UX:*:*)
    11831234        echo sx4-nec-superux${UNAME_RELEASE}
     
    12061257    *:Darwin:*:*)
    12071258        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    1208         case $UNAME_PROCESSOR in
    1209             i386)
    1210                 eval $set_cc_for_build
    1211                 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
    1212                   if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    1213                       (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    1214                       grep IS_64BIT_ARCH >/dev/null
    1215                   then
    1216                       UNAME_PROCESSOR="x86_64"
    1217                   fi
    1218                 fi ;;
    1219             unknown) UNAME_PROCESSOR=powerpc ;;
    1220         esac
     1259        eval $set_cc_for_build
     1260        if test "$UNAME_PROCESSOR" = unknown ; then
     1261            UNAME_PROCESSOR=powerpc
     1262        fi
     1263        if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
     1264            if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     1265                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
     1266                    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     1267                    grep IS_64BIT_ARCH >/dev/null
     1268                then
     1269                    case $UNAME_PROCESSOR in
     1270                        i386) UNAME_PROCESSOR=x86_64 ;;
     1271                        powerpc) UNAME_PROCESSOR=powerpc64 ;;
     1272                    esac
     1273                fi
     1274            fi
     1275        elif test "$UNAME_PROCESSOR" = i386 ; then
     1276            # Avoid executing cc on OS X 10.9, as it ships with a stub
     1277            # that puts up a graphical alert prompting to install
     1278            # developer tools.  Any system running Mac OS X 10.7 or
     1279            # later (Darwin 11 and later) is required to have a 64-bit
     1280            # processor. This is not true of the ARM version of Darwin
     1281            # that Apple uses in portable devices.
     1282            UNAME_PROCESSOR=x86_64
     1283        fi
    12211284        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
    12221285        exit ;;
     
    12321295        echo i386-pc-qnx
    12331296        exit ;;
    1234     NSE-?:NONSTOP_KERNEL:*:*)
     1297    NEO-?:NONSTOP_KERNEL:*:*)
     1298        echo neo-tandem-nsk${UNAME_RELEASE}
     1299        exit ;;
     1300    NSE-*:NONSTOP_KERNEL:*:*)
    12351301        echo nse-tandem-nsk${UNAME_RELEASE}
    12361302        exit ;;
     
    12771343        exit ;;
    12781344    SEI:*:*:SEIUX)
    1279         echo mips-sei-seiux${UNAME_RELEASE}
     1345        echo mips-sei-seiux${UNAME_RELEASE}
    12801346        exit ;;
    12811347    *:DragonFly:*:*)
     
    12831349        exit ;;
    12841350    *:*VMS:*:*)
    1285         UNAME_MACHINE=`(uname -p) 2>/dev/null`
     1351        UNAME_MACHINE=`(uname -p) 2>/dev/null`
    12861352        case "${UNAME_MACHINE}" in
    12871353            A*) echo alpha-dec-vms ; exit ;;
     
    13011367        echo ${UNAME_MACHINE}-pc-aros
    13021368        exit ;;
     1369    x86_64:VMkernel:*:*)
     1370        echo ${UNAME_MACHINE}-unknown-esx
     1371        exit ;;
    13031372esac
    1304 
    1305 #echo '(No uname command or uname output not recognized.)' 1>&2
    1306 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    1307 
    1308 eval $set_cc_for_build
    1309 cat >$dummy.c <<EOF
    1310 #ifdef _SEQUENT_
    1311 # include <sys/types.h>
    1312 # include <sys/utsname.h>
    1313 #endif
    1314 main ()
    1315 {
    1316 #if defined (sony)
    1317 #if defined (MIPSEB)
    1318   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
    1319      I don't know....  */
    1320   printf ("mips-sony-bsd\n"); exit (0);
    1321 #else
    1322 #include <sys/param.h>
    1323   printf ("m68k-sony-newsos%s\n",
    1324 #ifdef NEWSOS4
    1325           "4"
    1326 #else
    1327           ""
    1328 #endif
    1329          ); exit (0);
    1330 #endif
    1331 #endif
    1332 
    1333 #if defined (__arm) && defined (__acorn) && defined (__unix)
    1334   printf ("arm-acorn-riscix\n"); exit (0);
    1335 #endif
    1336 
    1337 #if defined (hp300) && !defined (hpux)
    1338   printf ("m68k-hp-bsd\n"); exit (0);
    1339 #endif
    1340 
    1341 #if defined (NeXT)
    1342 #if !defined (__ARCHITECTURE__)
    1343 #define __ARCHITECTURE__ "m68k"
    1344 #endif
    1345   int version;
    1346   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
    1347   if (version < 4)
    1348     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
    1349   else
    1350     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
    1351   exit (0);
    1352 #endif
    1353 
    1354 #if defined (MULTIMAX) || defined (n16)
    1355 #if defined (UMAXV)
    1356   printf ("ns32k-encore-sysv\n"); exit (0);
    1357 #else
    1358 #if defined (CMU)
    1359   printf ("ns32k-encore-mach\n"); exit (0);
    1360 #else
    1361   printf ("ns32k-encore-bsd\n"); exit (0);
    1362 #endif
    1363 #endif
    1364 #endif
    1365 
    1366 #if defined (__386BSD__)
    1367   printf ("i386-pc-bsd\n"); exit (0);
    1368 #endif
    1369 
    1370 #if defined (sequent)
    1371 #if defined (i386)
    1372   printf ("i386-sequent-dynix\n"); exit (0);
    1373 #endif
    1374 #if defined (ns32000)
    1375   printf ("ns32k-sequent-dynix\n"); exit (0);
    1376 #endif
    1377 #endif
    1378 
    1379 #if defined (_SEQUENT_)
    1380     struct utsname un;
    1381 
    1382     uname(&un);
    1383 
    1384     if (strncmp(un.version, "V2", 2) == 0) {
    1385         printf ("i386-sequent-ptx2\n"); exit (0);
    1386     }
    1387     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
    1388         printf ("i386-sequent-ptx1\n"); exit (0);
    1389     }
    1390     printf ("i386-sequent-ptx\n"); exit (0);
    1391 
    1392 #endif
    1393 
    1394 #if defined (vax)
    1395 # if !defined (ultrix)
    1396 #  include <sys/param.h>
    1397 #  if defined (BSD)
    1398 #   if BSD == 43
    1399       printf ("vax-dec-bsd4.3\n"); exit (0);
    1400 #   else
    1401 #    if BSD == 199006
    1402       printf ("vax-dec-bsd4.3reno\n"); exit (0);
    1403 #    else
    1404       printf ("vax-dec-bsd\n"); exit (0);
    1405 #    endif
    1406 #   endif
    1407 #  else
    1408     printf ("vax-dec-bsd\n"); exit (0);
    1409 #  endif
    1410 # else
    1411     printf ("vax-dec-ultrix\n"); exit (0);
    1412 # endif
    1413 #endif
    1414 
    1415 #if defined (alliant) && defined (i860)
    1416   printf ("i860-alliant-bsd\n"); exit (0);
    1417 #endif
    1418 
    1419   exit (1);
    1420 }
    1421 EOF
    1422 
    1423 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
    1424         { echo "$SYSTEM_NAME"; exit; }
    1425 
    1426 # Apollos put the system type in the environment.
    1427 
    1428 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
    1429 
    1430 # Convex versions that predate uname can use getsysinfo(1)
    1431 
    1432 if [ -x /usr/convex/getsysinfo ]
    1433 then
    1434     case `getsysinfo -f cpu_type` in
    1435     c1*)
    1436         echo c1-convex-bsd
    1437         exit ;;
    1438     c2*)
    1439         if getsysinfo -f scalar_acc
    1440         then echo c32-convex-bsd
    1441         else echo c2-convex-bsd
    1442         fi
    1443         exit ;;
    1444     c34*)
    1445         echo c34-convex-bsd
    1446         exit ;;
    1447     c38*)
    1448         echo c38-convex-bsd
    1449         exit ;;
    1450     c4*)
    1451         echo c4-convex-bsd
    1452         exit ;;
    1453     esac
    1454 fi
    14551373
    14561374cat >&2 <<EOF
  • trunk/config.sub

    r378 r481  
    11#! /bin/sh
    22# Configuration validation subroutine script.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    5 #   Free Software Foundation, Inc.
    6 
    7 timestamp='2010-01-22'
    8 
    9 # This file is (in principle) common to ALL GNU software.
    10 # The presence of a machine in this file suggests that SOME GNU software
    11 # can handle that machine.  It does not imply ALL GNU software can.
    12 #
    13 # This file is free software; you can redistribute it and/or modify
    14 # it under the terms of the GNU General Public License as published by
    15 # the Free Software Foundation; either version 2 of the License, or
     3#   Copyright 1992-2014 Free Software Foundation, Inc.
     4
     5timestamp='2014-09-11'
     6
     7# This file is free software; you can redistribute it and/or modify it
     8# under the terms of the GNU General Public License as published by
     9# the Free Software Foundation; either version 3 of the License, or
    1610# (at your option) any later version.
    1711#
    18 # This program is distributed in the hope that it will be useful,
    19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21 # GNU General Public License for more details.
     12# This program is distributed in the hope that it will be useful, but
     13# WITHOUT ANY WARRANTY; without even the implied warranty of
     14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15# General Public License for more details.
    2216#
    2317# You should have received a copy of the GNU General Public License
    24 # along with this program; if not, write to the Free Software
    25 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    26 # 02110-1301, USA.
     18# along with this program; if not, see <http://www.gnu.org/licenses/>.
    2719#
    2820# As a special exception to the GNU General Public License, if you
    2921# distribute this file as part of a program that contains a
    3022# configuration script generated by Autoconf, you may include it under
    31 # the same distribution terms that you use for the rest of that program.
    32 
    33 
    34 # Please send patches to <config-patches@gnu.org>.  Submit a context
    35 # diff and a properly formatted GNU ChangeLog entry.
     23# the same distribution terms that you use for the rest of that
     24# program.  This Exception is an additional permission under section 7
     25# of the GNU General Public License, version 3 ("GPLv3").
     26
     27
     28# Please send patches with a ChangeLog entry to config-patches@gnu.org.
    3629#
    3730# Configuration subroutine to validate and canonicalize a configuration type.
     
    7669GNU config.sub ($timestamp)
    7770
    78 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    79 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
    80 Software Foundation, Inc.
     71Copyright 1992-2014 Free Software Foundation, Inc.
    8172
    8273This is free software; see the source for copying conditions.  There is NO
     
    125116maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    126117case $maybe_os in
    127   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
    128   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
     118  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
     119  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
     120  knetbsd*-gnu* | netbsd*-gnu* | \
    129121  kopensolaris*-gnu* | \
    130122  storm-chaos* | os2-emx* | rtmk-nova*)
    131123    os=-$maybe_os
    132124    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     125    ;;
     126  android-linux)
     127    os=-linux-android
     128    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
    133129    ;;
    134130  *)
     
    154150        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    155151        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    156         -apple | -axis | -knuth | -cray | -microblaze)
     152        -apple | -axis | -knuth | -cray | -microblaze*)
    157153                os=
    158154                basic_machine=$1
    159155                ;;
    160         -bluegene*)
    161                 os=-cnk
     156        -bluegene*)
     157                os=-cnk
    162158                ;;
    163159        -sim | -cisco | -oki | -wec | -winbond)
     
    175171                basic_machine=$1
    176172                ;;
    177         -chorusrdb)
    178                 os=-chorusrdb
     173        -chorusrdb)
     174                os=-chorusrdb
    179175                basic_machine=$1
    180                 ;;
     176                ;;
    181177        -hiux*)
    182178                os=-hiuxwe2
     
    222218        -isc*)
    223219                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     220                ;;
     221        -lynx*178)
     222                os=-lynxos178
     223                ;;
     224        -lynx*5)
     225                os=-lynxos5
    224226                ;;
    225227        -lynx*)
     
    247249        1750a | 580 \
    248250        | a29k \
     251        | aarch64 | aarch64_be \
    249252        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
    250253        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    251254        | am33_2.0 \
    252         | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
     255        | arc | arceb \
     256        | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
     257        | avr | avr32 \
     258        | be32 | be64 \
    253259        | bfin \
    254         | c4x | clipper \
     260        | c4x | c8051 | clipper \
    255261        | d10v | d30v | dlx | dsp16xx \
     262        | epiphany \
    256263        | fido | fr30 | frv \
    257264        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     265        | hexagon \
    258266        | i370 | i860 | i960 | ia64 \
    259267        | ip2k | iq2000 \
     268        | k1om \
     269        | le32 | le64 \
    260270        | lm32 \
    261271        | m32c | m32r | m32rle | m68000 | m68k | m88k \
    262         | maxq | mb | microblaze | mcore | mep | metag \
     272        | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
    263273        | mips | mipsbe | mipseb | mipsel | mipsle \
    264274        | mips16 \
     
    274284        | mipsisa32 | mipsisa32el \
    275285        | mipsisa32r2 | mipsisa32r2el \
     286        | mipsisa32r6 | mipsisa32r6el \
    276287        | mipsisa64 | mipsisa64el \
    277288        | mipsisa64r2 | mipsisa64r2el \
     289        | mipsisa64r6 | mipsisa64r6el \
    278290        | mipsisa64sb1 | mipsisa64sb1el \
    279291        | mipsisa64sr71k | mipsisa64sr71kel \
     292        | mipsr5900 | mipsr5900el \
    280293        | mipstx39 | mipstx39el \
    281294        | mn10200 | mn10300 \
     
    283296        | mt \
    284297        | msp430 \
    285         | nios | nios2 \
     298        | nds32 | nds32le | nds32be \
     299        | nios | nios2 | nios2eb | nios2el \
    286300        | ns16k | ns32k \
    287         | or32 \
     301        | open8 | or1k | or1knd | or32 \
    288302        | pdp10 | pdp11 | pj | pjl \
    289         | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
     303        | powerpc | powerpc64 | powerpc64le | powerpcle \
    290304        | pyramid \
    291         | rx \
     305        | riscv32 | riscv64 \
     306        | rl78 | rx \
    292307        | score \
    293308        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
     
    295310        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
    296311        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
    297         | spu | strongarm \
    298         | tahoe | thumb | tic4x | tic80 | tron \
     312        | spu \
     313        | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
    299314        | ubicom32 \
    300         | v850 | v850e \
     315        | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
    301316        | we32k \
    302         | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
     317        | x86 | xc16x | xstormy16 | xtensa \
    303318        | z8k | z80)
    304319                basic_machine=$basic_machine-unknown
    305320                ;;
    306         m6811 | m68hc11 | m6812 | m68hc12 | picochip)
    307                 # Motorola 68HC11/12.
     321        c54x)
     322                basic_machine=tic54x-unknown
     323                ;;
     324        c55x)
     325                basic_machine=tic55x-unknown
     326                ;;
     327        c6x)
     328                basic_machine=tic6x-unknown
     329                ;;
     330        m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
    308331                basic_machine=$basic_machine-unknown
    309332                os=-none
     
    313336        ms1)
    314337                basic_machine=mt-unknown
     338                ;;
     339
     340        strongarm | thumb | xscale)
     341                basic_machine=arm-unknown
     342                ;;
     343        xgate)
     344                basic_machine=$basic_machine-unknown
     345                os=-none
     346                ;;
     347        xscaleeb)
     348                basic_machine=armeb-unknown
     349                ;;
     350
     351        xscaleel)
     352                basic_machine=armel-unknown
    315353                ;;
    316354
     
    329367        580-* \
    330368        | a29k-* \
     369        | aarch64-* | aarch64_be-* \
    331370        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
    332371        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
    333         | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
     372        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
    334373        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    335374        | avr-* | avr32-* \
     375        | be32-* | be64-* \
    336376        | bfin-* | bs2000-* \
    337         | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
    338         | clipper-* | craynv-* | cydra-* \
     377        | c[123]* | c30-* | [cjt]90-* | c4x-* \
     378        | c8051-* | clipper-* | craynv-* | cydra-* \
    339379        | d10v-* | d30v-* | dlx-* \
    340380        | elxsi-* \
     
    342382        | h8300-* | h8500-* \
    343383        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
     384        | hexagon-* \
    344385        | i*86-* | i860-* | i960-* | ia64-* \
    345386        | ip2k-* | iq2000-* \
     387        | k1om-* \
     388        | le32-* | le64-* \
    346389        | lm32-* \
    347390        | m32c-* | m32r-* | m32rle-* \
    348391        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
    349         | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
     392        | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
     393        | microblaze-* | microblazeel-* \
    350394        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
    351395        | mips16-* \
     
    361405        | mipsisa32-* | mipsisa32el-* \
    362406        | mipsisa32r2-* | mipsisa32r2el-* \
     407        | mipsisa32r6-* | mipsisa32r6el-* \
    363408        | mipsisa64-* | mipsisa64el-* \
    364409        | mipsisa64r2-* | mipsisa64r2el-* \
     410        | mipsisa64r6-* | mipsisa64r6el-* \
    365411        | mipsisa64sb1-* | mipsisa64sb1el-* \
    366412        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
     413        | mipsr5900-* | mipsr5900el-* \
    367414        | mipstx39-* | mipstx39el-* \
    368415        | mmix-* \
    369416        | mt-* \
    370417        | msp430-* \
    371         | nios-* | nios2-* \
     418        | nds32-* | nds32le-* | nds32be-* \
     419        | nios-* | nios2-* | nios2eb-* | nios2el-* \
    372420        | none-* | np1-* | ns16k-* | ns32k-* \
     421        | open8-* \
     422        | or1k*-* \
    373423        | orion-* \
    374424        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
    375         | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
     425        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
    376426        | pyramid-* \
    377         | romp-* | rs6000-* | rx-* \
     427        | rl78-* | romp-* | rs6000-* | rx-* \
    378428        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
    379429        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    380430        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
    381431        | sparclite-* \
    382         | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
    383         | tahoe-* | thumb-* \
     432        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
     433        | tahoe-* \
    384434        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
    385         | tile-* | tilegx-* \
     435        | tile*-* \
    386436        | tron-* \
    387437        | ubicom32-* \
    388         | v850-* | v850e-* | vax-* \
     438        | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
     439        | vax-* \
    389440        | we32k-* \
    390         | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
     441        | x86-* | x86_64-* | xc16x-* | xps100-* \
    391442        | xstormy16-* | xtensa*-* \
    392443        | ymp-* \
     
    413464                os=-udi
    414465                ;;
    415         abacus)
     466        abacus)
    416467                basic_machine=abacus-unknown
    417468                ;;
     
    483534                os=-cnk
    484535                ;;
     536        c54x-*)
     537                basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
     538                ;;
     539        c55x-*)
     540                basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
     541                ;;
     542        c6x-*)
     543                basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
     544                ;;
    485545        c90)
    486546                basic_machine=c90-cray
    487547                os=-unicos
    488548                ;;
    489         cegcc)
     549        cegcc)
    490550                basic_machine=arm-unknown
    491551                os=-cegcc
     
    519579                os=-unicosmp
    520580                ;;
    521         cr16)
     581        cr16 | cr16-*)
    522582                basic_machine=cr16-unknown
    523583                os=-elf
     
    677737                basic_machine=i370-ibm
    678738                ;;
    679 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
    680739        i*86v32)
    681740                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
     
    735794                os=-sysv
    736795                ;;
    737         microblaze)
     796        microblaze*)
    738797                basic_machine=microblaze-xilinx
    739798                ;;
     799        mingw64)
     800                basic_machine=x86_64-pc
     801                os=-mingw64
     802                ;;
    740803        mingw32)
    741                 basic_machine=i386-pc
     804                basic_machine=i686-pc
    742805                os=-mingw32
    743806                ;;
     
    767830                os=-morphos
    768831                ;;
     832        moxiebox)
     833                basic_machine=moxie-unknown
     834                os=-moxiebox
     835                ;;
    769836        msdos)
    770837                basic_machine=i386-pc
     
    774841                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
    775842                ;;
     843        msys)
     844                basic_machine=i686-pc
     845                os=-msys
     846                ;;
    776847        mvs)
    777848                basic_machine=i370-ibm
    778849                os=-mvs
     850                ;;
     851        nacl)
     852                basic_machine=le32-unknown
     853                os=-nacl
    779854                ;;
    780855        ncr3000)
     
    842917                basic_machine=np1-gould
    843918                ;;
     919        neo-tandem)
     920                basic_machine=neo-tandem
     921                ;;
     922        nse-tandem)
     923                basic_machine=nse-tandem
     924                ;;
    844925        nsr-tandem)
    845926                basic_machine=nsr-tandem
     
    9241005        power)  basic_machine=power-ibm
    9251006                ;;
    926         ppc)    basic_machine=powerpc-unknown
    927                 ;;
    928         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
     1007        ppc | ppcbe)    basic_machine=powerpc-unknown
     1008                ;;
     1009        ppc-* | ppcbe-*)
     1010                basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    9291011                ;;
    9301012        ppcle | powerpclittle | ppc-le | powerpc-little)
     
    9511033                os=-pw32
    9521034                ;;
    953         rdos)
     1035        rdos | rdos64)
     1036                basic_machine=x86_64-pc
     1037                os=-rdos
     1038                ;;
     1039        rdos32)
    9541040                basic_machine=i386-pc
    9551041                os=-rdos
     
    10201106                os=-sysv4
    10211107                ;;
     1108        strongarm-* | thumb-*)
     1109                basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
     1110                ;;
    10221111        sun2)
    10231112                basic_machine=m68000-sun
     
    10761165                os=-unicos
    10771166                ;;
    1078         tic54x | c54x*)
    1079                 basic_machine=tic54x-unknown
    1080                 os=-coff
    1081                 ;;
    1082         tic55x | c55x*)
    1083                 basic_machine=tic55x-unknown
    1084                 os=-coff
    1085                 ;;
    1086         tic6x | c6x*)
    1087                 basic_machine=tic6x-unknown
    1088                 os=-coff
    1089                 ;;
    1090         # This must be matched before tile*.
    1091         tilegx*)
    1092                 basic_machine=tilegx-unknown
    1093                 os=-linux-gnu
    1094                 ;;
    10951167        tile*)
    1096                 basic_machine=tile-unknown
     1168                basic_machine=$basic_machine-unknown
    10971169                os=-linux-gnu
    10981170                ;;
     
    11631235        xps | xps100)
    11641236                basic_machine=xps100-honeywell
     1237                ;;
     1238        xscale-* | xscalee[bl]-*)
     1239                basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
    11651240                ;;
    11661241        ymp)
     
    12611336then
    12621337case $os in
    1263         # First match some system type aliases
    1264         # that might get confused with valid system types.
     1338        # First match some system type aliases
     1339        # that might get confused with valid system types.
    12651340        # -solaris* is a basic system type, with this one exception.
    1266         -auroraux)
    1267                 os=-auroraux
     1341        -auroraux)
     1342                os=-auroraux
    12681343                ;;
    12691344        -solaris1 | -solaris1.*)
     
    12891364              | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
    12901365              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
    1291               | -sym* | -kopensolaris* \
     1366              | -sym* | -kopensolaris* | -plan9* \
    12921367              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    12931368              | -aos* | -aros* \
     
    12951370              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    12961371              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
    1297               | -openbsd* | -solidbsd* \
     1372              | -bitrig* | -openbsd* | -solidbsd* \
    12981373              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
    12991374              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     
    13011376              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    13021377              | -chorusos* | -chorusrdb* | -cegcc* \
    1303               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1304               | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
    1305               | -uxpv* | -beos* | -mpeix* | -udk* \
     1378              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
     1379              | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
     1380              | -linux-newlib* | -linux-musl* | -linux-uclibc* \
     1381              | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
    13061382              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    13071383              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
     
    13101386              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    13111387              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
    1312               | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
     1388              | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
    13131389        # Remember, each alternative MUST END IN *, to match a version number.
    13141390                ;;
     
    13491425                os=-openedition
    13501426                ;;
    1351         -os400*)
     1427        -os400*)
    13521428                os=-os400
    13531429                ;;
     
    13981474                os=-sysv4
    13991475                ;;
    1400         -tpf*)
     1476        -tpf*)
    14011477                os=-tpf
    14021478                ;;
     
    14341510                os=-aros
    14351511                ;;
    1436         -kaos*)
    1437                 os=-kaos
    1438                 ;;
    14391512        -zvmoe)
    14401513                os=-zvmoe
     
    14431516                os=-dicos
    14441517                ;;
    1445         -nacl*)
    1446                 ;;
     1518        -nacl*)
     1519                ;;
    14471520        -none)
    14481521                ;;
     
    14671540
    14681541case $basic_machine in
    1469         score-*)
     1542        score-*)
    14701543                os=-elf
    14711544                ;;
    1472         spu-*)
     1545        spu-*)
    14731546                os=-elf
    14741547                ;;
     
    14821555                os=-aout
    14831556                ;;
    1484         c4x-* | tic4x-*)
    1485                 os=-coff
     1557        c4x-* | tic4x-*)
     1558                os=-coff
     1559                ;;
     1560        c8051-*)
     1561                os=-elf
     1562                ;;
     1563        hexagon-*)
     1564                os=-elf
     1565                ;;
     1566        tic54x-*)
     1567                os=-coff
     1568                ;;
     1569        tic55x-*)
     1570                os=-coff
     1571                ;;
     1572        tic6x-*)
     1573                os=-coff
    14861574                ;;
    14871575        # This must come before the *-dec entry.
     
    15031591        m68000-sun)
    15041592                os=-sunos3
    1505                 # This also exists in the configure program, but was not the
    1506                 # default.
    1507                 # os=-sunos4
    15081593                ;;
    15091594        m68*-cisco)
    15101595                os=-aout
    15111596                ;;
    1512         mep-*)
     1597        mep-*)
    15131598                os=-elf
    15141599                ;;
     
    15371622                os=-aix
    15381623                ;;
    1539         *-knuth)
     1624        *-knuth)
    15401625                os=-mmixware
    15411626                ;;
  • trunk/configure.ac

    r477 r481  
    1212dnl start
    1313dnl
    14 AM_INIT_AUTOMAKE(samhain, 3.1.6)
     14AM_INIT_AUTOMAKE(samhain, 4.0.0.rc1)
    1515AC_DEFINE([SAMHAIN], 1, [Application is samhain])
    1616AC_CANONICAL_HOST
     
    4040
    4141AC_HEADER_STDC
    42 dnl
    43 dnl first one is a dummy because of an autoconf bug
    44 dnl (no HAVE_... for first one)
    45 dnl
    46 AC_CHECK_HEADERS([sys/ipc.h sys/msg.h sys/uio.h fcntl.h])
     42
     43AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/msg.h sys/uio.h fcntl.h])
    4744
    4845
     
    395392)
    396393AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes",  statfs="no")
    397 AC_CHECK_VA_COPY
     394SL_CHECK_VA_COPY
    398395AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
    399396AC_CHECK_MLOCK
     
    532529SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
    533530SH_CHECK_TYPEDEF(uint16_t, HAVE_UINT16_T)
     531SH_CHECK_TYPEDEF(uint32_t, HAVE_UINT32_T)
    534532SH_CHECK_TYPEDEF(uint64_t, HAVE_UINT64_T)
    535533if test "$sh_HAVE_LONG_LONG" = "yes"; then
     
    946944                mytclient="-DSH_WITH_CLIENT"
    947945                yulectl_prg=
     946                samhainadmin_prg=
    948947                setpwd_prg="samhain_setpwd"
    949948                sh_main_prg="samhain"
     
    958957                mytclient="-DSH_WITH_SERVER"
    959958                yulectl_prg="yulectl"
     959                samhainadmin_prg="scripts/samhainadmin.pl"
    960960                setpwd_prg="samhain_setpwd"
    961961                sh_main_prg="yule"
     
    968968                mytclient="-DSH_STANDALONE"
    969969                yulectl_prg=
     970                samhainadmin_prg=
    970971                setpwd_prg=
    971972                sh_main_prg="samhain"
     
    981982        setpwd_prg=
    982983        yulectl_prg=
     984        samhainadmin_prg=
    983985        sh_main_prg="samhain"
    984986dnl     AC_CHECK_HEADER(sys/capability.h,
     
    990992AC_SUBST(setpwd_prg)
    991993AC_SUBST(yulectl_prg)
     994AC_SUBST(samhainadmin_prg)
    992995AC_SUBST(sh_main_prg)
    993996AC_SUBST(mytclient)
     
    10131016                  LIBS="${tmp_LIBS}"
    10141017                fi
    1015                 AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
    1016                 if test "x$GCC" = "xyes"; then
    1017                         sh_no_gcc_static=no
    1018                         LDFLAGS="$LDFLAGS -static"
     1018
     1019                if test "x$GCC" = "xyes";
     1020                then
     1021                   case "$host_os" in
     1022
     1023                        *solaris*)
     1024                                AC_MSG_WARN([option --enable-static ignored on Solaris])
     1025                                ;;
     1026                       
     1027                        *)
     1028                                AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
     1029                                sh_no_gcc_static=no
     1030                                LDFLAGS="$LDFLAGS -static"
     1031                                ;;
     1032                    esac
    10191033                else
     1034                   AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
    10201035                   sh_no_gcc_static=yes
    10211036                   case "$host_os" in
     
    17441759  fi
    17451760
    1746 dnl  if test ! -z "`echo "$CFLAGS" | grep "\-O2" 2> /dev/null`" ; then
    1747 dnl    CFLAGS=`echo $CFLAGS | sed 's%\-O2%\-O3%' `
    1748 dnl  fi
    1749 
     1761dnl  -W is the older name for -Wextra
     1762
     1763 
    17501764  if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
    1751     CFLAGS="$CFLAGS -Wall -W "
     1765     case "$host_os" in
     1766        *solaris*)
     1767           CFLAGS="$CFLAGS -Wall -W -Wno-missing-braces "
     1768           ;;
     1769        *)
     1770           CFLAGS="$CFLAGS -Wall -W "
     1771           ;;
     1772     esac
    17521773  fi
    17531774
     
    18641885        if test "x${enable_encrypt}" = xno; then
    18651886           myencrypt=no
    1866         elif test "x${enable_encrypt}" = "x1"; then
    1867            myencrypt=1 
    18681887        fi
    18691888        ]
     
    18721891        AC_DEFINE(SH_ENCRYPT)
    18731892        AC_DEFINE(SH_ENCRYPT_2)
    1874 elif test "x${myencrypt}" = "x1"; then
    1875         AC_DEFINE(SH_ENCRYPT)
    18761893fi
    18771894
     
    20682085AC_SUBST(need_user_install)
    20692086
    2070 sh_insmod_cmd=": # no kernel module"
    2071 sh_insmod_pre=": # no kernel module"
    2072 sh_lkm=""
    2073 lkm_inc=""
    2074 khidemap="/boot/System.map"
    2075 sh_syscalltable="0x0"
    2076 AC_ARG_ENABLE(khide,
    2077         [  --enable-khide=SYSTEM_MAP    use kernel module to hide (Linux only)[[/boot/System.map]]],
    2078         [
    2079         if test "x${enable_khide}" != xno; then
    2080 
    2081            kernel_testsupport=`uname -r | sed s,^3.*,LINUX3,`
    2082            if test "x${kernel_testsupport}" = "xLINUX3"; then
    2083               AC_MSG_ERROR([The --enable-khide option is not supported on Linux kernel version 3.x or above.])
    2084            fi
    2085 
    2086            if test "x${enableval}" != "xyes"; then
    2087                 khidemap="${enableval}"
    2088            fi
    2089            sh_syscalltable=`egrep '(D|d|R|r) sys_call_table' ${khidemap} | awk '{print $1}'`
    2090            if test x"$sh_syscalltable" = x; then
    2091                 AC_MSG_ERROR([Option --enable-khide cannot be used since the symbol sys_call_table was not found in ${khidemap}.])
    2092            fi
    2093            sh_syscalltable="0x${sh_syscalltable}"
    2094            install_name_len=`echo ${install_name} | awk '{ print(length()); }'`
    2095            if test "${install_name_len}" -gt 15 ; then
    2096                 AC_MSG_ERROR([If --enable-khide is used, install_name must not exceed a length of 15 chars.])
    2097            fi
    2098            AC_DEFINE(SH_USE_LKM)
    2099            AC_DEFINE_UNQUOTED(SH_MAGIC_HIDE, "${install_name}")
    2100 
    2101            # -- NEW --
    2102            kernel_version=`uname -r | sed s,2.6.*,LINUX26,`
    2103            kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
    2104            AC_DEFINE_UNQUOTED(SH_KERNEL_NUMERIC, ${kernel_numeric}, [Kernel number])
    2105 
    2106            if test x"$kernel_version" = xLINUX26
    2107            then
    2108                 AC_MSG_CHECKING([for modlist_lock])
    2109                 sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'`
    2110                 if test x"$sh_modlist_lock" = x; then
    2111                         AC_MSG_RESULT(no)
    2112                 else
    2113                         sh_modlist_lock="0x${sh_modlist_lock}"
    2114                         AC_MSG_RESULT([${sh_modlist_lock}])
    2115                         AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
    2116                 fi
    2117 
    2118                 AC_MSG_CHECKING([for module_mutex])                 
    2119                 sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'`
    2120                 if test x"$sh_modlist_mutex" = x; then
    2121                         AC_MSG_RESULT(no)
    2122                 else
    2123                         sh_modlist_mutex="0x${sh_modlist_mutex}"
    2124                         AC_MSG_RESULT([${sh_modlist_mutex}])
    2125                         AC_DEFINE_UNQUOTED(SH_MODLIST_MUTEX, ${sh_modlist_mutex}, [The address of the modules list mutex])
    2126                 fi
    2127 
    2128                 sh_list_modules=`egrep 'd modules$' ${khidemap} | awk '{print $1}'`
    2129                 if test x"$sh_list_modules" = x; then
    2130                         AC_MSG_ERROR([Option --enable-khide cannot be used, since the symbol modules was not found in ${khidemap}.])
    2131                 fi
    2132                 sh_list_modules="0x${sh_list_modules}"
    2133                 AC_DEFINE_UNQUOTED(SH_LIST_MODULES, ${sh_list_modules}, [The address of the modules list])
    2134 
    2135                 AC_DEFINE(LINUX26, 1, [Define if kernel is 2.6])
    2136                 sh_insmod_cmd="modprobe ${install_name}_hide"
    2137                 sh_lkm="samhain_hide.ko"
    2138            else
    2139                 sh_insmod_cmd="insmod ${install_name}_hide; insmod ${install_name}_erase; rmmod ${install_name}_erase"
    2140                 sh_lkm="samhain_hide.o samhain_erase.o"
    2141            fi
    2142            # -- END NEW --
    2143 
    2144            kvers=`uname -r`
    2145            if test -f /lib/modules/${kvers}/build/include/linux/kernel.h; then
    2146                 lkm_inc="-I/lib/modules/${kvers}/build/include"
    2147            else
    2148                 AC_MSG_WARN([--enable-khide: /lib/modules/${kvers}/build/include/linux not found])
    2149                 AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
    2150                 AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
    2151            fi
    2152 
    2153            AC_MSG_CHECKING([for 2.4 vanilla kernel])
    2154            sh_is_vanilla_kernel=yes
    2155            if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
    2156                 grep 'next_task,' /lib/modules/${kvers}/build/include/linux/sched.h  >/dev/null 2>&1 || sh_is_vanilla_kernel=no
    2157            fi
    2158            if test x"${sh_is_vanilla_kernel}" = xno; then
    2159                 AC_MSG_RESULT(no)
    2160            else
    2161                 AC_MSG_RESULT(yes)
    2162                 AC_DEFINE(SH_VANILLA_KERNEL)
    2163            fi
    2164 
    2165         fi
    2166         ]
    2167 )
    2168 
    21692087AC_SUBST(install_name)
    21702088AC_SUBST(INSTALL_NAME)
     
    21942112)
    21952113
    2196 
    2197 systemmap="/boot/System.map"
    2198 sh_libkvm=""
    2199 AC_ARG_WITH(kcheck,
    2200         [  --with-kcheck[[=SYSTEM_MAP]] check Linux/FreeBSD/OpenBSD kernel integrity [[/boot/System.map]]],
    2201         [
    2202         if test "x${withval}" != "xno"; then
    2203                 AC_DEFINE(SH_USE_KERN)
    2204 
    2205                 kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
    2206                 AC_DEFINE_UNQUOTED(SH_KERNEL_NUMBER, ${kernel_numeric}, [Kernel number])
    2207 
    2208                 kernelversion=`uname -r`
    2209                 AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
    2210 
    2211                 if test "x${withval}" != "xyes"; then
    2212                         systemmap="${withval}"
    2213                 fi
    2214 
    2215                 if test "x${cross_compiling}" = xyes; then
    2216                         :
    2217                 elif test "x$selectconfig" = "xfreebsd"; then
    2218                         LIBS="$LIBS -lkvm"
    2219                         sh_libkvm="-lkvm"
    2220                 elif test -f "${systemmap}"; then
    2221 
    2222                         test_kmap_open=no
    2223 
    2224                         if test -c /dev/kmem; then
    2225                            AC_MSG_CHECKING([whether /dev/kmem is useable])
    2226                            dd bs=4 count=16 if=/dev/kmem of=/dev/null >/dev/null 2>&1
    2227                            if test $? -eq 0; then
    2228                               test_kmap_open=yes
    2229                            fi
    2230                            AC_MSG_RESULT([${test_kmap_open}])
    2231                         fi
    2232 
    2233                         if test x"${test_kmap_open}" = xno; then
    2234                            # need kernel module
    2235 
    2236                            if test -f /lib/modules/${kernelversion}/build/include/linux/kernel.h; then
    2237                               lkm_inc="-I/lib/modules/${kernelversion}/build/include"
    2238                            else
    2239                                AC_MSG_WARN([--enable-khide: /lib/modules/${kernelversion}/build/include/linux not found])
    2240                                AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
    2241                                AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
    2242                            fi
    2243 
    2244                            AC_MSG_CHECKING([for vmlist_lock])
    2245                            sh_vmlist_lock=`egrep ['[bdBD] vmlist_lock$'] ${systemmap} | awk '{print $1}'`
    2246                            if test x"$sh_vmlist_lock" = x; then
    2247                                AC_MSG_RESULT(no)
    2248                            else
    2249                                sh_vmlist_lock="0x${sh_vmlist_lock}"
    2250                                AC_MSG_RESULT([${sh_vmlist_lock}])
    2251                                AC_DEFINE_UNQUOTED(SH_VMLIST_LOCK, ${sh_vmlist_lock}, [The address of the vmlist spinlock])
    2252                            fi
    2253 
    2254                            AC_MSG_CHECKING([for vmlist])
    2255                            sh_vmlist=`egrep ['[bdBD] vmlist$'] ${systemmap} | awk '{print $1}'`
    2256                            if test x"$sh_vmlist" = x; then
    2257                                AC_MSG_RESULT(no)
    2258                            else
    2259                                sh_vmlist="0x${sh_vmlist}"
    2260                                AC_MSG_RESULT([${sh_vmlist}])
    2261                                AC_DEFINE_UNQUOTED(SH_VMLIST, ${sh_vmlist}, [The address of the vmlist])
    2262                            fi
    2263 
    2264                            sh_lkm="${sh_lkm} samhain_kmem.ko"
    2265                            sh_insmod_pre="modprobe ${install_name}_kmem"
    2266 
    2267                         fi
    2268                 else
    2269                         AC_MSG_ERROR([Option --with-kcheck=systemmap cannot be used, because system map ${systemmap} does not exist.])
    2270                 fi
    2271         fi
    2272         ]
    2273 )
    2274 
    2275 AC_SUBST(lkm_inc)
    2276 AC_SUBST(sh_lkm)
    2277 AC_SUBST(sh_insmod_cmd)
    2278 AC_SUBST(sh_insmod_pre)
    2279 
    2280 AC_SUBST(systemmap)
    2281 AC_SUBST(sh_libkvm)
    22822114
    22832115AC_ARG_ENABLE(base,
     
    24252257)
    24262258
     2259
     2260
    24272261AC_ARG_WITH(keyid,
    24282262        [  --with-keyid=KEYID           specify KeyID (0x...) for GPG/PGP functions [[none]]],
     
    28962730        echo "  Configuration file: ${myconffile}"
    28972731        echo "        Manual pages: ${mandir}"
    2898         echo "                Data: ${mydataroot}"
     2732        echo "      Data directory: ${mydataroot}"
     2733        echo "       Database file: ${mydatafile}"
    28992734        echo "            PID file: ${mylockfile}"
    29002735        echo "            Log file: ${mylogfile}"
  • trunk/depend.dep

    r452 r481  
    11
    22# DO NOT DELETE THIS LINE
    3 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h
    4 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ignore.h
     3samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h
     4sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ignore.h
    55sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h
    6 sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h
    7 sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/CuTest.h
    8 sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h
    9 sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_forward.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h
     6sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h
     7sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/sh_dbIO.h $(srcinc)/CuTest.h
     8sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbCheck.h $(srcinc)/sh_dbCreate.h $(srcinc)/sh_sem.h $(srcinc)/sh_extern.h
     9sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_xfer.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/sh_socket.h
    1010sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_checksum.h
    1111sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h
     
    1313sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h
    1414sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h
    15 sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h
     15sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_hash.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h
    1616sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/sh_nmail.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h
    1717sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h
    1818sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h
    1919sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h
    20 sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h
     20sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h
    2121sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h
    2222sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h
    23 sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h
     23sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h
    2424sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h $(srcinc)/CuTest.h
    25 sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h
     25sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h $(srcinc)/CuTest.h
    2626sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h
    27 sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h
    28 sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h
     27sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_xfer.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h
     28sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_gpg.h
    2929sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h
    3030sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_calls.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_sub.h $(srcinc)/sh_utils.h
     
    3232sh_database.o: $(srcsrc)/sh_database.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
    3333sh_err_log.o: $(srcsrc)/sh_err_log.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h
    34 sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
     34sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_sem.h
    3535sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h
    36 sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h
     36sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_schedule.h
    3737bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h
    3838mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h
     
    4747minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h
    4848slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h
    49 rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h
     49rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h
    5050rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h
    5151zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h
    52 sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h
     52sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_guid.h $(srcinc)/sh_fifo.h $(srcinc)/sh_utils.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h $(srcinc)/CuTest.h
    5353sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h
    5454yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h
     
    8989sh_filetype.o: $(srcsrc)/sh_filetype.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h
    9090sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h
    91 sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h
     91sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h
    9292sh_checksum.o: $(srcsrc)/sh_checksum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_checksum.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h
     93sh_guid.o: $(srcsrc)/sh_guid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h
     94sh_dbIO.o: $(srcsrc)/sh_dbIO.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_gpg.h $(srcinc)/sh_tiger.h $(srcinc)/sh_xfer.h $(srcinc)/sh_pthread.h $(srcinc)/sh_socket.h $(srcinc)/sh_files.h $(srcinc)/zAVLTree.h
     95sh_dbCheck.o: $(srcsrc)/sh_dbCheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h
     96sh_dbCreate.o: $(srcsrc)/sh_dbCreate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h $(srcinc)/sh_guid.h
     97sh_xfer_client.o: $(srcsrc)/sh_xfer_client.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h
     98sh_xfer_server.o: $(srcsrc)/sh_xfer_server.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/sh_guid.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h
     99sh_xfer_syslog.o: $(srcsrc)/sh_xfer_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h
     100sh_xload_client.o: $(srcsrc)/sh_xload_client.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_guid.h
     101sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h
  • trunk/depend.sum

    r452 r481  
    1 3192621362
     12959213307
  • trunk/docs/Changelog

    r476 r481  
    1 3.1.6:
    2         * More modern and more complete VA_COPY autoconf macro
    3           (from the openwrt project)
     14.0.0:
     2        * new -w CL option to wait on scan completion
     3        * new option ReportCheckflags
     4        * enhance testsuite to cover new functionality
     5        * implement draft for change control integration:
     6          * new database format to store change flags
     7          * refactoring of db I/O and client/server code
     8          * option StartupLoadDelay
     9          * --create-database CL option
     10          * --outfile CL option
     11          * --binary, --list-filter CL options
     12          * --verify-database CL option
     13          * yulectl -c DELTA:<uuid> command
     14          * option SetDeltaRetryCount
     15          * option SetDeltaRetryInterval
     16          * update documentation
     17        * remove old/unused code
     18        * fix compiler warnings with gcc 5.1.0
     19        * update config.sub, config.guess
     20
     213.1.6 (08-06-2015):
    422        * Modify testcompile.sh to remove 'smatch' and use 'clang'
    523          instead.
  • trunk/docs/README.UPGRADE

    r297 r481  
     1to 4.0.0 and higher: if you use "ReportCheckflags = yes" (off by default),
     2  you need to change the database scheme:
     3
     4  -- mysql:
     5          ALTER TABLE samhain.log ADD COLUMN checkflags_old BIGINT UNSIGNED;
     6          ALTER TABLE samhain.log ADD COLUMN checkflags_new BIGINT UNSIGNED;
     7
     8  -- postgres:
     9          ALTER TABLE samhain.log ADD COLUMN checkflags_old NUMERIC(20);
     10          ALTER TABLE samhain.log ADD COLUMN checkflags_new NUMERIC(20);
     11
     12  --oracle:
     13          ALTER TABLE samhain.log ADD checkflags_old NUMBER(20);
     14          ALTER TABLE samhain.log ADD checkflags_new NUMBER(20);
     15
    116to 2.8.0 and higher: samhain supports IPv6 now, which means that the
    217  size of the 'ip' column in the database must be increased from
     
    4055  -- this may cause spurious warnings about modified links, if you check
    4156     against a database created with an earlier version of samhain
    42 
    43 
    4457
    4558from lower to 2.3.x: the database scheme has changed slightly.
  • trunk/include/rijndael-alg-fst.h

    r230 r481  
    1 /*
    2  * rijndael-alg-fst.h   v2.3   April '2000
     1/*      $NetBSD: rijndael-alg-fst.h,v 1.4 2005/12/11 12:20:52 christos Exp $    */
     2/*      $KAME: rijndael-alg-fst.h,v 1.5 2003/07/15 10:47:16 itojun Exp $        */
     3/**
     4 * rijndael-alg-fst.h
    35 *
    4  * Optimised ANSI C code
     6 * @version 3.0 (December 2000)
    57 *
     8 * Optimised ANSI C code for the Rijndael cipher (now AES)
     9 *
     10 * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
     11 * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
     12 * @author Paulo Barreto <paulo.barreto@terra.com.br>
     13 *
     14 * This code is hereby placed in the public domain.
     15 *
     16 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
     17 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
     20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    627 */
    7 
    8 /*@-fixedformalarray@*/
    9 
    1028#ifndef __RIJNDAEL_ALG_FST_H
    1129#define __RIJNDAEL_ALG_FST_H
    1230
    13 #define MAXKC                   (256/32)
    14 #define MAXROUNDS               14
    15 
    16 /* USUAL_TYPES */
    17 #ifndef USUAL_TYPES
    18 #define USUAL_TYPES
    19 typedef unsigned char   byte;
    20 typedef unsigned char   word8; 
    21 typedef unsigned short  word16;
    22 typedef unsigned int    word32;
    23 #endif
     31#define RIJNDAEL_MAXKC  (256/32)
     32#define RIJNDAEL_MAXKB  (256/8)
     33#define RIJNDAEL_MAXNR  14
    2434
    2535#ifdef SH_ENCRYPT
    2636
    27 int rijndaelKeySched(word8 k[MAXKC][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
    28 
    29 int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS);
    30 
    31 int rijndaelEncrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
    32 
    33 
    34 int rijndaelDecrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
    35 
    36 #ifdef INTERMEDIATE_VALUE_KAT
    37 int rijndaelEncryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds);
    38 int rijndaelDecryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds);
    39 #endif
     37int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
     38int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
     39void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]);
     40void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]);
    4041
    4142/* SH_ENCRYPT */
    4243#endif
    43 
    44 /* __RIJNDAEL_ALG_FST_H */
    45 #endif
    46 
     44#endif /* __RIJNDAEL_ALG_FST_H */
  • trunk/include/rijndael-api-fst.h

    r230 r481  
    1 /*
    2  * rijndael-api-fst.h   v2.3   April '2000
     1/*      $NetBSD: rijndael-api-fst.h,v 1.8 2007/01/21 23:00:08 cbiere Exp $      */
     2
     3/**
     4 * rijndael-api-fst.h
    35 *
    4  * Optimised ANSI C code
     6 * @version 2.9 (December 2000)
    57 *
     8 * Optimised ANSI C code for the Rijndael cipher (now AES)
     9 *
     10 * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
     11 * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
     12 * @author Paulo Barreto <paulo.barreto@terra.com.br>
     13 *
     14 * This code is hereby placed in the public domain.
     15 *
     16 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
     17 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
     20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27 *
     28 * Acknowledgements:
     29 *
     30 * We are deeply indebted to the following people for their bug reports,
     31 * fixes, and improvement suggestions to this implementation. Though we
     32 * tried to list all contributions, we apologise in advance for any
     33 * missing reference.
     34 *
     35 * Andrew Bales <Andrew.Bales@Honeywell.com>
     36 * Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
     37 * John Skodon <skodonj@webquill.com>
    638 */
    739
     
    941#define __RIJNDAEL_API_FST_H
    1042
     43/* Blocksize: 16 * 8 = 128; 128 * 1 = 128 */
     44#define     B_SIZ    16
     45#define     BNUM      1
     46
     47
     48#if defined(UINT32)
     49typedef unsigned char u8;
     50typedef UINT32 u32;
     51#else
     52
     53typedef unsigned char u8;
     54#if defined(HAVE_INT_32)
     55typedef unsigned int u32;
     56#elif defined(HAVE_LONG_32)
     57typedef unsigned long u32;
     58#elif defined(HAVE_SHORT_32)
     59typedef unsigned short u32;
     60#else
     61#error "No 32 bit integer type found"
     62#endif
     63
     64#endif
     65
    1166#include "rijndael-alg-fst.h"
    1267
    13 /*  Defines:
    14     Add any additional defines you need
    15 */
    16 
    17 #define     BNUM                  1
    18 #define     B_SIZ                 16
    19 #define     STRICT_ALIGN          1 /*  For safety          */
    20 
    21 
     68/*  Generic Defines  */
    2269#define     DIR_ENCRYPT           0 /*  Are we encrpyting?  */
    2370#define     DIR_DECRYPT           1 /*  Are we decrpyting?  */
     
    3380#define     BITSPERBLOCK        128 /* Default number of bits in a cipher block */
    3481
    35 /*  Error Codes - CHANGE POSSIBLE: inclusion of additional error codes  */
    36 
     82/*  Error Codes  */
    3783#define     BAD_KEY_DIR          -1 /*  Key direction is invalid, e.g., unknown value */
    3884#define     BAD_KEY_MAT          -2 /*  Key material not of correct length */
     
    4591#define     BAD_OTHER            -9 /*  Unknown error */
    4692
    47 /*  CHANGE POSSIBLE:  inclusion of algorithm specific defines  */
    48 #define     MAX_KEY_SIZE         64 /* # of ASCII char's needed to represent a key */
    49 #define     MAX_IV_SIZE          16 /* # bytes needed to represent an IV  */
     93/*  Algorithm-specific Defines  */
     94#define     RIJNDAEL_MAX_KEY_SIZE         64 /* # of ASCII char's needed to represent a key */
     95#define     RIJNDAEL_MAX_IV_SIZE          16 /* # bytes needed to represent an IV  */
    5096
    5197#ifdef SH_ENCRYPT
    5298
    53 /*  Typedefs:
     99/*  Typedefs  */
    54100
    55         Typedef'ed data storage elements.  Add any algorithm specific
    56 parameters at the bottom of the structs as appropriate.
    57 */
    58 
    59 typedef unsigned char   RIJ_BYTE;
     101typedef unsigned char   BYTE;
    60102
    61103/*  The structure for key information */
    62104typedef struct {
    63     RIJ_BYTE  direction;                /* Key used for encrypting or decrypting? */
    64     int   keyLen;                   /* Length of the key  */
    65     char  keyMaterial[MAX_KEY_SIZE+1];  /* Raw key data in ASCII, e.g., user input or KAT values */
    66         /*  The following parameters are algorithm dependent, replace or add as necessary  */
    67         int   ROUNDS;                   /* key-length-dependent number of rounds */
    68     int   blockLen;                 /* block length */
    69     word8 keySched[MAXROUNDS+1][4][4];  /* key schedule         */
     105  u32   rk[4*(RIJNDAEL_MAXNR + 1)];        /* key schedule */
     106  u32   ek[4*(RIJNDAEL_MAXNR + 1)];        /* CFB1 key schedule (encryption only) */
     107  BYTE  direction;                /* Key used for encrypting or decrypting? */
     108  int   keyLen;                   /* Length of the key  */
     109  char  keyMaterial[RIJNDAEL_MAX_KEY_SIZE+1];  /* Raw key data in ASCII, e.g., user input or KAT values */
     110  int   Nr;                       /* key-length-dependent number of rounds */
    70111} keyInstance;
    71112
    72113/*  The structure for cipher information */
    73114typedef struct {                    /* changed order of the components */
    74     RIJ_BYTE  mode;                     /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
    75     RIJ_BYTE  IV[MAX_IV_SIZE];          /* A possible Initialization Vector for ciphering */
    76         /*  Add any algorithm specific parameters needed here  */
    77     int   blockLen;                 /* Sample: Handles non-128 bit block sizes (if available) */
     115    u32  IV[RIJNDAEL_MAX_IV_SIZE / sizeof(u32)];
     116                        /* A possible Initialization Vector for ciphering */
     117    BYTE  mode;                     /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
    78118} cipherInstance;
    79119
    80120/*  Function prototypes  */
    81 /*  CHANGED: nothing
    82         TODO: implement the following extensions to setup 192-bit and 256-bit block lengths:
    83         makeKeyEx():    parameter blockLen added
    84                         -- this parameter is absolutely necessary if you want to
    85                         setup the round keys in a variable block length setting
    86             cipherInitEx(): parameter blockLen added (for obvious reasons)             
    87  */
    88121
    89 int makeKey(keyInstance *key, RIJ_BYTE direction, int keyLen, char *keyMaterial);
     122int rijndael_makeKey(keyInstance *, BYTE, int, const char *);
    90123
    91 int cipherInit(cipherInstance *cipher, RIJ_BYTE mode, char *IV);
     124int rijndael_cipherInit(cipherInstance *, BYTE, const char *);
    92125
    93 int blockEncrypt(cipherInstance *cipher, keyInstance *key,
    94                  RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer);
     126int rijndael_blockEncrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
    95127
    96 int blockDecrypt(cipherInstance *cipher, keyInstance *key,
    97                  RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer);
    98 #ifdef INTERMEDIATE_VALUE_KAT
    99 int cipherUpdateRounds(cipherInstance *cipher, keyInstance *key,
    100                        RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer, int rounds);
    101 #endif
     128int rijndael_padEncrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
     129
     130int rijndael_blockDecrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
     131
     132int rijndael_padDecrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
    102133
    103134/* SH_ENCRYPT */
    104135#endif
    105 
    106 /*  __RIJNDAEL_API_FST_H */
    107 #endif
     136#endif /* __RIJNDAEL_API_FST_H */
  • trunk/include/samhain.h

    r459 r481  
    2828#endif
    2929
     30#if defined(__GNUC__) && (__GNUC__ >= 4)
     31#define SH_GNUC_SENTINEL __attribute__((__sentinel__))
     32#else
     33#define SH_GNUC_SENTINEL
     34#endif
     35
     36#if defined(__GNUC__) && (__GNUC__ >= 3)
     37#undef  SH_GNUC_PURE
     38#define SH_GNUC_PURE     __attribute__((pure))
     39#undef  SH_GNUC_CONST
     40#define SH_GNUC_CONST    __attribute__((const))
     41#undef  SH_GNUC_NORETURN
     42#define SH_GNUC_NORETURN __attribute__((noreturn))
     43#undef  SH_GNUC_MALLOC
     44#define SH_GNUC_MALLOC   __attribute__((malloc))
     45#else
     46#undef  SH_GNUC_PURE
     47#define SH_GNUC_PURE
     48#undef  SH_GNUC_CONST
     49#define SH_GNUC_CONST
     50#undef  SH_GNUC_NORETURN
     51#define SH_GNUC_NORETURN
     52#undef  SH_GNUC_MALLOC
     53#define SH_GNUC_MALLOC
     54#endif
     55
    3056/**************************************************
    3157 *
     
    5783
    5884/* end IPv6 */
    59 
    60 #define REPLACE_OLD
    6185
    6286/* Standard buffer sizes.
     
    101125#define PW_LEN     8
    102126
    103 #undef  GOOD
    104 #define GOOD  1
    105 #undef  BAD
    106 #define BAD   0
    107 #undef  ON
    108 #define ON    1
    109 #undef  OFF
    110 #define OFF   0
    111127#undef  S_TRUE
    112128#define S_TRUE    1
    113129#undef  S_FALSE
    114130#define S_FALSE   0
     131
     132#undef  GOOD
     133#define GOOD  S_TRUE
     134#undef  BAD
     135#define BAD   S_FALSE
     136
     137
     138#ifdef HAVE_INTTYPES_H
     139#include <inttypes.h>
     140#endif
     141#ifdef HAVE_STDINT_H
     142#include <stdint.h>
     143#endif
     144
     145#if !defined(HAVE_UINT16_T)
     146#define UINT16 unsigned short
     147#else
     148#define UINT16 uint16_t
     149#endif
     150
     151#if !defined(HAVE_UINT32_T)
    115152
    116153/* An unsigned integer guaranteed to be 32 bit.
     
    129166#endif
    130167
    131 #ifdef HAVE_INTTYPES_H
    132 #include <inttypes.h>
    133 #endif
    134 #ifdef HAVE_STDINT_H
    135 #include <stdint.h>
    136 #endif
    137 
    138 #if !defined(HAVE_UINT16_T)
    139 #define UINT16 unsigned short
    140 #else
    141 #define UINT16 uint16_t
     168#else
     169#define UINT32 uint32_t
     170#define SINT32 int32_t
     171
    142172#endif
    143173
     
    305335  int    client_severity;          /* TRUE if client severity used    */
    306336  int    client_class;             /* TRUE if client class used       */
     337  int    hidefile;                 /* TRUE if file not shown in log   */
     338  int    inotify;                  /* Flags for inotify               */
    307339  int    audit;
    308340  unsigned long aud_mask;
    309   int    hidefile;                 /* TRUE if file not shown in log   */
    310   int    inotify;                  /* Flags for inotify               */
    311341} sh_sh_flag;
    312342
     
    347377  /*@null@*//*@out@*/ char   * timezone;
    348378
     379  int delayload;
     380
    349381#ifdef SCREW_IT_UP
    350382  int sigtrap_max_duration;
    351383#endif
    352384
     385  char * outpath;
    353386} sh_struct;
    354387
     
    365398extern volatile  int      sig_termfast;           /* SIGTERM */
    366399extern volatile  int      sig_force_check;        /* SIGTTOU */
     400extern volatile  int      sh_load_delta_flag;
    367401
    368402extern long int eintr__result;
     
    420454#endif
    421455
    422 #if defined(__GNUC__) && (__GNUC__ >= 4)
    423 #define SH_GNUC_SENTINEL __attribute__((__sentinel__))
    424 #else
    425 #define SH_GNUC_SENTINEL
    426 #endif
    427 
    428 #if defined(__GNUC__) && (__GNUC__ >= 3)
    429 #undef  SH_GNUC_PURE
    430 #define SH_GNUC_PURE     __attribute__((pure))
    431 #undef  SH_GNUC_CONST
    432 #define SH_GNUC_CONST    __attribute__((const))
    433 #undef  SH_GNUC_NORETURN
    434 #define SH_GNUC_NORETURN __attribute__((noreturn))
    435 #undef  SH_GNUC_MALLOC
    436 #define SH_GNUC_MALLOC   __attribute__((malloc))
    437 #else
    438 #undef  SH_GNUC_PURE
    439 #define SH_GNUC_PURE
    440 #undef  SH_GNUC_CONST
    441 #define SH_GNUC_CONST
    442 #undef  SH_GNUC_NORETURN
    443 #define SH_GNUC_NORETURN
    444 #undef  SH_GNUC_MALLOC
    445 #define SH_GNUC_MALLOC
    446 #endif
    447456
    448457
     
    481490#ifdef USE_SUID
    482491#define MLOCK(a, b) \
    483       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     492      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
    484493        (void) sl_set_suid(); \
    485         if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; \
     494        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = S_TRUE; \
    486495        (void) sl_unset_suid(); }
    487496#else
    488497#define MLOCK(a, b) \
    489       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
    490         if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; }
     498      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
     499        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = S_TRUE; }
    491500#endif
    492501#else
     
    498507#ifdef USE_SUID
    499508#define MUNLOCK(a, b) \
    500       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     509      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
    501510        (void) sl_set_suid(); \
    502511        (void) sh_unix_munlock( a, b );\
     
    504513#else
    505514#define MUNLOCK(a, b) \
    506       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     515      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
    507516        (void) sh_unix_munlock( a, b ); }
    508517#endif
  • trunk/include/sh_calls.h

    r317 r481  
    3030
    3131/*@-fixedformalarray@*/
     32
     33#include "config_xor.h"
     34#if defined(__GNUC__) && (__GNUC__ >= 3)
     35#undef  SH_GNUC_NORETURN
     36#define SH_GNUC_NORETURN __attribute__((noreturn))
     37#else
     38#undef  SH_GNUC_NORETURN
     39#define SH_GNUC_NORETURN
     40#endif
     41
    3242
    3343/* Set aud functions
     
    8393                             int * o_noatime);
    8494/*@noreturn@*/
    85 void     aud_exit   (const char * file, int line, int fd);
     95void     aud_exit   (const char * file, int line, int fd) SH_GNUC_NORETURN;
    8696/*@noreturn@*/
    87 void     aud__exit  (const char * file, int line, int fd);
     97void     aud__exit  (const char * file, int line, int fd) SH_GNUC_NORETURN;
    8898pid_t    aud_fork   (const char * file, int line);
    8999int      aud_pipe   (const char * file, int line, int modus[2]);
  • trunk/include/sh_cat.h

    r294 r481  
    7575 MSG_CHECK_0,     
    7676 MSG_CHECK_1,     
     77 MSG_CHECK_2,     
    7778 MSG_STAMP,       
    7879                 
     
    8081 MSG_D_DSTART,   
    8182 MSG_D_FAIL,     
    82 
     83 MSG_D_DELTAOK,
     84 MSG_D_DELTAFAIL,
    8385
    8486#ifndef HAVE_URANDOM
     
    98100 MSG_SUID_QREPORT,
    99101 MSG_SUID_ERROR,
    100 #endif
    101 
    102 #ifdef SH_USE_KERN
    103  /* FreeBSD */
    104  MSG_KERN_POLICY,   
    105  MSG_KERN_POL_CO,
    106 
    107  /* Linux */
    108  MSG_KERN_SYSCALL,
    109  MSG_KERN_PROC,
    110  MSG_KERN_IDT,
    111  MSG_KERN_GATE,
    112102#endif
    113103
  • trunk/include/sh_error.h

    r410 r481  
    178178int sh_error_setdebug (char * debug_s);
    179179
    180 /* error messages
    181  */
    182 /*@owned@*/char * sh_error_message (int tellme, char * str, size_t len);
    183 
    184180/* switch on/off log to file temporarily
    185181 */
     
    198194void reset_count_dev_console(void);
    199195
     196/* close the message queue [no-op if !defined(WITH_MESSAGE_QUEUE)]
     197 */
     198void close_ipc (void);
     199
    200200#ifdef WITH_MESSAGE_QUEUE
    201 /* close the message queue
    202  */
    203 void close_ipc (void);
    204 
    205201/* enable message queue
    206202 */
  • trunk/include/sh_error_min.h

    r272 r481  
    3535int sh_error_convert_level (const char * str_s);
    3636
     37/* error messages
     38 */
     39char * sh_error_message (int tellme, char * str, size_t len);
     40
    3741#endif
  • trunk/include/sh_extern.h

    r415 r481  
    4242 *    executes shell command
    4343 */
    44 int sh_ext_popen_init (sh_tas_t * task, char * command, char * argv0, ...) SH_GNUC_SENTINEL;
     44int sh_ext_popen_init (sh_tas_t * task, const char * command, char * argv0, ...) SH_GNUC_SENTINEL;
    4545
    4646/*
     
    5252 * -- Execute command, return first line of output
    5353 */
    54 char * sh_ext_popen_str (char * command);
     54char * sh_ext_popen_str (const char * command);
    5555
    5656/*
  • trunk/include/sh_fifo.h

    r272 r481  
    3333} SH_FIFO;
    3434
     35#define SH_FIFO_INITIALIZER { NULL, NULL, 0 }
     36
    3537/*****************************************************
    3638 *
     
    4244 *
    4345 */
    44 #define fifo_init(fifo_p) { fifo_p->fifo_cts = 0; fifo_p->head_ptr = NULL; \
    45  fifo_p->tail_ptr = NULL; }
     46#define fifo_init(fifo_p) { (fifo_p)->fifo_cts = 0; (fifo_p)->head_ptr = NULL; \
     47    (fifo_p)->tail_ptr = NULL; }
    4648
    4749
     
    5052 * Returns: -1 if the list is full, 0 on success
    5153 */
    52 int push_list (SH_FIFO * fifo, char * indat, int in_i, const char * in_str);
     54int push_list (SH_FIFO * fifo, const char * indat, int in_i, const char * in_str);
     55#define sh_fifo_push(a, b) push_list((a), (b), 0, NULL)
    5356
    5457/* Push an item on the tail of the list.
     
    5659 * Returns: -1 if the list is full, 0 on success
    5760 */
    58 int push_tail_list (SH_FIFO * fifo, char * indat, int in_i, const char * in_str);
     61int push_tail_list (SH_FIFO * fifo, const char * indat, int in_i, const char * in_str);
     62#define sh_fifo_push_tail(a, b) push_tail_list((a), (b), 0, NULL)
    5963
    6064/* pop an item from the tail of the list
     
    6468 */
    6569char * pop_list (SH_FIFO * fifo);
     70#define sh_fifo_pop(a) pop_list((a))
    6671
     72/* ----  Special functions -------------------------------------------------*/
    6773
     74/* This is for eMail where different recipients may be eligible for         *
     75 * different subsets of messages. We need to delete all that were sent      *
     76 * to all intended recipients, and keep all with at least one failure.      */
     77
     78/* Iterate over list and check for each if it is valid for 'tag';
     79 * i.e. (item->s_extra == tag). If yes, add to the returned string.
     80 * If (okNull == False) then item->s_xtra must be defined
     81 */
    6882sh_string * tag_list (SH_FIFO * fifo, char * tag,
    6983                      int(*check)(int, const char*, const char*, const void*),
    7084                      const void * info, int okNull);
     85
     86/* Flag all tagged as candidate to keep */
    7187void rollback_list (SH_FIFO * fifo);
     88/* Flag all tagged as candidate to delete */
    7289void mark_list (SH_FIFO * fifo);
     90/* Remove all flags */
    7391void reset_list (SH_FIFO * fifo);
     92/* Delete all marked for delete that are not flagged for keep */
    7493int commit_list (SH_FIFO * fifo);
    7594
  • trunk/include/sh_files.h

    r457 r481  
    3131};
    3232
     33/* Fix the check flags
     34 */
     35void sh_files_fixup_mask (int class, unsigned long * check_flags);
     36
     37/* Dequote a filename in the config file
     38 */
     39char * sh_files_parse_input(const char * str_s, size_t * len);
     40
    3341/* Check whether a file is in the config
    3442 */
     
    233241int sh_files_redef_allignore(const char * str);
    234242
    235 ShFileType sh_files_filecheck (int class, unsigned long check_mask,
     243ShFileType sh_files_filecheck (int class, unsigned long check_flags,
    236244                               const char * dirName,
    237245                               const char * infileName,
     
    239247                               int rsrcflag);
    240248
    241 int sh_files_checkdir (int iclass, unsigned long check_mask,
     249int sh_files_checkdir (int iclass, unsigned long check_flags,
    242250                       int idepth, char * iname,
    243251                       char * relativeName);
    244252
    245253int sh_files_search_file(char * name, int * class,
    246                          unsigned long *check_mask, int * reported);
     254                         unsigned long *check_flags, int * reported);
    247255int sh_files_search_dir(char * name, int * class,
    248                         unsigned long *check_mask, int *reported,
     256                        unsigned long *check_flags, int *reported,
    249257                        int * rdepth);
    250258void sh_files_set_file_reported(const char * name);
  • trunk/include/sh_gpg.h

    r347 r481  
    2323#define SH_GPG_H
    2424
     25#define SIG_CONF 1
     26#define SIG_DATA 2
     27
    2528/* Top level function to verify file.
    2629 */
     
    3033 * and/or database cannot be verified; otherwise returns 0
    3134 */
    32 int sh_gpg_check_sign (long file_1, long file_2, int what);
     35int sh_gpg_check_sign (long file, int what);
    3336
    3437/* log successful startup
  • trunk/include/sh_hash.h

    r458 r481  
    2828#include "sh_error.h"
    2929
     30/* the report_checkflags flag
     31 */
     32int get_report_checkflags();
     33
     34/* whether to report checkflags
     35 */
     36int set_report_checkflags(const char * c);
     37
    3038/* convert to policy string
    3139 */
     
    4048int hashreport_missing( char *fullpath, int level);
    4149
     50/* remove internal db record for a file (checks for some flags).
     51 */
     52void sh_hash_remove (const char * path);
     53
    4254/* remove internal db record for a file
    4355 */
    44 void sh_hash_remove (const char * path);
    45 
    46 /* write database to stdout
    47  */
    48 int sh_hash_pushdata_stdout (const char * str);
    49 
    50 /* version string for database
    51  */
    52 int sh_hash_version_string(const char * str);
     56void sh_hash_remove_unconditional (const char * path);
     57
     58/* Insert a "null" record in-memory (representing a missing file).
     59 */
     60void sh_hash_insert_null(char * str);
     61
     62#ifdef SH_DBIO_INT_H
     63/* Check for "null" record
     64 */
     65int sh_hash_is_null_record(sh_filestore_t * theFile);
     66#endif
    5367
    5468/* Dont report on ctm/mtm change for directories
     
    5670int sh_hash_loosedircheck(const char * str);
    5771
    58 /* List database content
    59  */
    60 int sh_hash_list_db (const char * db_file);
    61 
    6272/* List database content for a single file
    6373 */
    6474int set_list_file (const char * c);
    6575
     76/* Set the path of that file
     77 */
     78char * get_list_file();
     79
    6680/* List database content with full detail
    6781 */
     
    7589 */
    7690void sh_hash_init (void);
     91
     92/* Check init status
     93 */
     94int sh_hash_get_initialized();
     95
     96/* Read the database from disk and fill sh.data.hash with checksum.
     97 */
     98void sh_hash_init_and_checksum();
     99
     100/* Set status to 'database is read in'.
     101 */
     102void sh_hash_set_initialized();
    77103
    78104/* Check whether a file is present in the database.
  • trunk/include/sh_html.h

    r1 r481  
    5353  int                     encf_flag;
    5454  int                     ency_flag;
     55  int                     ivst_flag;
    5556  int                     status_now;
    5657  int                     status_arr[CLT_MAX];
  • trunk/include/sh_inotify.h

    r373 r481  
    3232
    3333int sh_inotify_add_watch(char * filename, sh_watches * watches, int  * errnum,
    34                          int class, unsigned long check_mask, int type, int rdepth);
     34                         int class, unsigned long check_flags, int type, int rdepth);
    3535
    3636int sh_inotify_add_watch_later(const char * filename, sh_watches * watches,
    3737                               int  * errnum,
    38                                int class, unsigned long check_mask,
     38                               int class, unsigned long check_flags,
    3939                               int type, int rdepth);
    4040
    4141char * sh_inotify_pop_dormant(sh_watches * watches, int * class,
    42                               unsigned long * check_mask, int * type, int * rdepth);
     42                              unsigned long * check_flags, int * type, int * rdepth);
    4343
    4444void sh_inotify_purge_dormant(sh_watches * watches);
     
    4747
    4848char * sh_inotify_search_item(sh_watches * watches, int watch,
    49                               int * class, unsigned long * check_mask,
     49                              int * class, unsigned long * check_flags,
    5050                              int * type, int * rdepth);
    5151ssize_t sh_inotify_read(char * buffer, size_t count);
  • trunk/include/sh_prelink.h

    r102 r481  
    66 * alert_timeout: timeout for read
    77 */
    8 int sh_prelink_run (char * path, char * file_hash, int alert_timeout);
     8int sh_prelink_run (char * path, char * file_hash, int alert_timeout, unsigned long mask);
    99
    1010/* return S_TRUE if ELF file, S_FALSE otherwise
  • trunk/include/sh_socket.h

    r200 r481  
    88
    99#if defined (SH_WITH_CLIENT)
    10 void sh_socket_server_cmd(const char * srvcmd);
     10char * sh_socket_get_uuid(int * errflag, unsigned int * count, time_t * last);
     11int    sh_socket_store_uuid(const char * cmd);
     12int    sh_socket_return_uuid(const char * uuid, unsigned int count, time_t last);
     13void   sh_socket_server_cmd(const char * srvcmd);
     14int    set_delta_retry_interval(const char * str);
     15int    set_delta_retry_count(const char * str);
    1116#endif
    1217
  • trunk/include/sh_tiger.h

    r170 r481  
    4444int sh_tiger_get_hashtype (void);
    4545
     46/* set the hash fuction in use in the mask
     47 */
     48void sh_tiger_get_mask_hashtype(unsigned long * mask);
     49
     50
     51/* reset the hash function to the one in the mask
     52 */
     53void sh_tiger_set_hashtype_mask(unsigned long mask);
     54
    4655/* GnuPG-like format, returns allocated memory
    4756 */
  • trunk/include/sh_tools.h

    r295 r481  
    88 */
    99#define SH_PROTO_SRP (1 << 0)
     10#define SH_PROTO_IVA (1 << 1)
    1011#define SH_PROTO_MSG (1 << 2)
    1112#define SH_PROTO_BIG (1 << 3)
    1213#define SH_PROTO_END (1 << 4)
    13 #define SH_PROTO_ENC (1 << 5)
     14#define SH_PROTO_EN1 (1 << 5)
    1415#define SH_PROTO_EN2 (1 << 6)
     16#define SH_PROTO_ENC (SH_PROTO_EN1|SH_PROTO_EN2)
    1517#define SH_MASK_ENC (SH_PROTO_ENC|SH_PROTO_EN2)
    1618
     
    4446#if defined (SH_WITH_SERVER)
    4547
     48unsigned char sh_tools_probe_store(unsigned char protocol, int * probe_flag);
     49
    4650int get_open_max (void);
    4751
    48 void put_header (/*@out@*/unsigned char * head, int protocol,
     52void put_header (/*@out@*/unsigned char * head, const int protocol,
    4953                 unsigned long * length, char * u);
    5054
     
    5963/* returns allocated buffer
    6064 */
    61 char * get_client_conf_file (char * peer, unsigned long * length);
     65char * get_client_conf_file (const char * peer, unsigned long * length);
    6266
    6367/* returns allocated buffer
    6468 */
    65 char * get_client_data_file (char * peer, unsigned long * length);
     69char * get_client_data_file (const char * peer, unsigned long * length);
    6670
     71/* returns allocated buffer
     72 */
     73char * get_client_uuid_file (const char * peer, unsigned long * length, const char * uuid);
    6774#endif
     75
    6876
    6977unsigned long read_port (int sockfd, char *buf, unsigned long nbytes,
     
    7280
    7381#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
     82
     83void sh_tools_probe_reset();
    7484
    7585unsigned long write_port (int sockfd, char *buf, unsigned long nbytes,
  • trunk/include/sh_trace.h

    r1 r481  
    99#define ASSERT(expr, expr1) \
    1010      if (!(expr)) \
    11          fprintf(stderr, \
     11        { \
     12         fprintf(stderr,            \
    1213                 SDG_AERRO, \
    13                  FIL__, __LINE__, expr1 );
     14                 FIL__, __LINE__, expr1 ); \
     15          abort(); \
     16        }
    1417
    1518
  • trunk/include/sh_unix.h

    r425 r481  
    6868/* inode        */
    6969#define MODI_INO (1 << 2)
     70
    7071/* user         */
    7172#define MODI_USR (1 << 3)
     
    7475/* mtime        */
    7576#define MODI_MTM (1 << 5)
     77
    7678/* ctime        */
    7779#define MODI_CTM (1 << 6)
     
    8082/* size         */
    8183#define MODI_SIZ (1 << 8)
     84
    8285/* file mode    */
    8386#define MODI_MOD (1 << 9)
     
    8689/* device type   */
    8790#define MODI_RDEV (1 << 11)
     91
    8892/* size may grow   */
    8993#define MODI_SGROW (1 << 12)
    9094/* use prelink     */
    9195#define MODI_PREL (1 << 13)
    92 
    9396/* get content     */
    9497#define MODI_TXT ((1 << 14)|MODI_CHK)
     
    98101#define MODI_AUDIT (1 << 15)
    99102#define MODI_AUDIT_ENABLED(a) (((a)&(1 << 15))!=0)
    100 
    101 #define MODI_INIT 0xDA000000UL
    102 #define MODI_INITIALIZED(a) (((a) & 0xFF000000UL) == MODI_INIT)
     103/* do not check  */
     104#define MODI_NOCHECK (1 << 16)
     105/* do not check  */
     106#define MODI_ALLIGNORE (1 << 17)
     107
     108#define MODI_TIGER192  0x01000000UL
     109#define MODI_SHA1      0x02000000UL
     110#define MODI_MD5       0x03000000UL
     111#define MODI_SHA256    0x04000000UL
     112#define MODI_HASHTYPE  0x0F000000UL
     113
     114#define MODI_INIT 0xD0000000UL
     115#define MODI_INITIALIZED(a) (((a) & 0xF0000000UL) == MODI_INIT)
     116
     117#define MODI_SET(a, b) ((a) |= (b))
     118#define MODI_CLEAR(a, b) ((a) &= ~(b))
     119#define MODI_ISSET(a, b) (((a) & (b)) != 0)
    103120
    104121#define SH_TXT_MAX 9200
     
    128145
    129146typedef struct file_struct {
    130   unsigned long    check_mask;
     147  unsigned long    check_flags;
    131148  int              file_reported;
    132149  char             fullpath[PATH_MAX];
     
    314331 */
    315332int sh_check_rotated_log (const char * path, 
    316                           UINT64 old_size, UINT64 old_inode, const char * old_hash);
     333                          UINT64 old_size, UINT64 old_inode, const char * old_hash, unsigned long mask);
    317334
    318335/* obtain file info
  • trunk/include/slib.h

    r428 r481  
    6060 * TRUE, FALSE
    6161 */
    62 #define SL_TRUE  1
    63 #define SL_FALSE 0
     62#if !defined(S_TRUE)
     63#define S_TRUE  1
     64#define S_FALSE 0
     65#endif
    6466
    6567#define SH_GRBUF_SIZE   4096
  • trunk/init/samhain.startGentoo.in

    r321 r481  
    99start() {
    1010        ebegin "Starting @install_name@"
    11         @sh_insmod_pre@
    1211        /sbin/start-stop-daemon --start --quiet  --exec @sbindir@/@install_name@
    1312        eend $?
    14         @sh_insmod_cmd@
    1513}
    1614
  • trunk/init/samhain.startLSB.in

    r321 r481  
    8787case "$1" in
    8888  start)
    89         #
    90         # Preloaded kernel module
    91         #
    92         @sh_insmod_pre@
    93         #
    9489        ${DAEMON} start
    9590        ERRNUM=$?
    96         #
    97         # The hiding kernel module
    98         #
    99         if [ $ERRNUM -eq 0 ]; then
    100                 @sh_insmod_cmd@
    101         fi
    102         #
    10391        SH_ACT="started"
    10492        ;;
  • trunk/init/samhain.startLinux.in

    r466 r481  
    11#!/bin/bash
     2
    23# chkconfig: 2345 99 10
    34# description: File Integrity Checking Daemon
     
    89# database: @mydatafile@
    910#
     11
     12### BEGIN INIT INFO
     13# Provides: @install_name@
     14# Required-Start: $syslog $network
     15# Required-Stop: $syslog $network
     16# Default-Start: 2 3 4 5
     17# Default-Stop: 0 1 6
     18# Short-Description: Keep an eye on stuff
     19# Description: Keep an eye on stuff
     20### END INIT INFO
    1021
    1122# For Debian
     
    140151        fi
    141152        #
    142         # Preloaded kernel module
    143         #
    144         @sh_insmod_pre@
    145         #
    146153        case "$DISTRO" in
    147154        debian)
    148155                echo -n "Starting ${NAME}"
    149                 ( /sbin/start-stop-daemon --start --quiet --exec $DAEMON )
     156                ( /sbin/start-stop-daemon --start --oknodo --quiet --exec $DAEMON )
    150157                RETVAL=$?
    151158                debian_end
     
    183190                ;;
    184191        esac
    185         #
    186         # The hiding kernel module
    187         #
    188         if [ $RETVAL -eq 0 ]; then
    189                 @sh_insmod_cmd@
    190         fi
    191192        exit $RETVAL
    192193        ;;
     
    196197        debian)
    197198                echo -n "Stopping $NAME"
    198                 ( /sbin/start-stop-daemon --stop --quiet --exec $DAEMON )
     199                ( /sbin/start-stop-daemon --stop --oknodo --quiet --exec $DAEMON )
    199200                RETVAL=$?
    200201                debian_end
  • trunk/man/samhain.8

    r169 r481  
    1 .TH SAMHAIN 8 "07 August 2004" "" "Samhain manual"
     1.TH SAMHAIN 8 "26 June 2015" "" "Samhain manual"
    22.SH NAME
    33samhain \- check file integrity
     
    2121} [\-D | \-\-daemon | \-\-foreground] [\-\-forever] [\-r DEPTH,\-\-recursion=DEPTH] [log-options]
    2222
     23.B samhain
     24[ \-p threshold ] {
     25.I \-\-verify\-database=database
     26}
     27
     28.B samhain
     29[ \-p threshold ] {
     30.I \-\-create\-database=file\-list
     31}
     32
     33
     34
    2335.SS "LISTING THE DATABASE"
    2436.PP
     
    2739[\-a | \-\-full\-detail]
    2840[\-\-delimited]
     41[\-\-binary]
     42[\-\-list\-filter=file]
    2943\-d
    3044.IR file |
     
    245259configuration file.
    246260
     261.PP
     262.B samhain
     263[ \-p\ threshold ]
     264.I "\-\-verify\-database=database"
     265
     266Check the filesystem against the database given as argument,
     267and exit with an appropriate exit status. The configuration file
     268will
     269.B not
     270be read.
     271
     272.PP
     273.B samhain
     274[ \-p\ threshold ]
     275.I "\-\-create\-database=file\-list"
     276
     277Initialize a database from the given file list.
     278The configuration file
     279will
     280.B not
     281be read. The policy used will be
     282.I ReadOnly.
     283File content will be stored for a file
     284if its path in the list is preceded with a
     285.B +
     286sign.
     287
    247288.SS "OPTIONS FOR LISTING THE DATABASE"
    248289.PP
     
    267308List all informations for each file, in a comma-separated format.
    268309Must precede the \-d option.
     310.TP
     311[\-\-binary]
     312List data in the binary format of the database, thus writing another
     313database.
     314Must precede the \-d option.
     315.TP
     316.RI [\-\-list\-filter= file ]
     317Filter the output of the database listing by a list of files given
     318in a text file. Together with \-\-binary this allows to write a
     319partial database. Must precede the \-d option.
    269320.TP
    270321.RI [\-\-list\-file= file ]
  • trunk/man/samhainrc.5

    r169 r481  
    253253by same user, and logouts.
    254254.TP
    255 .I "[Kernel]"
    256 Configuration for detecting kernel rootkits.
    257 .br
    258 .BI KernelCheckActive= 0|1
    259 Switch off/on checking of kernel syscalls to detect kernel module rootkits.
    260 .br
    261 .BI KernelCheckInterval= val
    262 Interval (seconds) between checks.
    263 .br
    264 .BI SeverityKernel= val
    265 Severity level for clobbered kernel syscalls.
    266 .br
    267 .BI KernelCheckIDT= 0|1
    268 Whether to check the interrrupt descriptor table.
    269 .br
    270 .BI KernelSystemCall= address
    271 The address of system_call (grep system_call System.map).
    272 Required after a kernel update.
    273 .br
    274 .BI KernelProcRoot= address
    275 The address of proc_root (grep ' proc_root$' System.map).
    276 Required after a kernel update.
    277 .br
    278 .BI KernelProcRootIops= address
    279 The address of proc_root_inode_operations
    280 (grep proc_root_inode_operations System.map).
    281 Required after a kernel update.
    282 .br
    283 .BI KernelProcRootLookup= address
    284 The address of proc_root_lookup (grep proc_root_lookup System.map).
    285 Required after a kernel update.
    286 .TP
    287255.I "[SuidCheck]"
    288256Settings for finding SUID/SGID files on disk.
     
    473441Set type of message authentication code (HMAC).
    474442Must be identical on client and server.
     443.br
     444.BI StartupLoadDelay= val
     445Defines the interval (in seconds) to wait after startup before
     446loading the databse from the server. Default is no wait.
    475447.br
    476448.BI SetLoopTime= val
  • trunk/rules.deb.in

    r425 r481  
    5252        #chmod o-rX `pwd`/debian/tmp/var/log/samhain \
    5353        #       `pwd`/debian/tmp/var/run/samhain \
    54         #       `pwd`/debian/tmp/var/state/samhain \
     54        #       `pwd`/debian/tmp/var/lib/samhain \
    5555        #       `pwd`/debian/tmp/etc/samhain
    5656
     
    7878        dh_installdebconf       
    7979        dh_installdocs
    80         [ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_3.html.tar ] && \
     80        [ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_4.html.tar ] && \
    8181                cd debian/@install_name@/usr/share/doc/@install_name@ && \
    82                 tar xf MANUAL-2_3.html.tar && mv MANUAL-2_3 manual.html && \
    83                 rm -f MANUAL-2_3.html.tar && \
    84                 mv MANUAL-2_3.pdf manual.pdf
     82                tar xf MANUAL-2_4.html.tar && mv MANUAL-2_4 manual.html && \
     83                rm -f MANUAL-2_4.html.tar && \
     84                mv MANUAL-2_4.pdf manual.pdf
    8585        dh_installexamples @top_srcdir@/scripts/example_pager.pl \
    8686                @top_srcdir@/scripts/example_sms.pl \
  • trunk/samhain-install.sh.in

    r442 r481  
    6565    echo 'action = install-boot|install-data|install-user'
    6666    echo '         uninstall|purge|uninstall-boot'
    67     echo '         uninstall-data|uninstall-man|uninstall-program|uninstall-lkm'
     67    echo '         uninstall-data|uninstall-man|uninstall-program'
    6868    echo 'samhain-install.sh --print-config <item>'
    6969    echo 'item = name | basekey | prefix | exec_prefix | sbin_dir | man_dir'
     
    514514            break;;
    515515
    516         uninstall-lkm)
    517             act=ulkm
    518             break;;
    519 
    520516        uninstall | remove | purge)
    521517            opts=
     
    525521            test x"$DESTDIR" = "x" || opts="$opts --destdir=$DESTDIR"
    526522            test x"$1" = "xpurge" && purge=yes
    527             echo "$0 $opts uninstall-lkm"
    528             eval $0 $opts uninstall-lkm
    529523            echo "$0 $opts uninstall-program"
    530524            eval $0 $opts uninstall-program
     
    680674              break
    681675              ;;
    682            Linux/* )
     676           Linux/* | GNU/kFreeBSD/* | GNU/* )
    683677               file=/etc/passwd
    684678               entry="${user}:*:${uid}:${gid}:${realname}:${home}:${shell}"
     
    886880        ;;
    887881
    888     Linux/*)
     882    Linux/* | GNU/kFreeBSD* | GNU/* )
    889883        rlv="2 3 4 5"
    890884        linkopt="-f -s"
     
    11451139fi
    11461140
    1147 if test x"${act}" = xulkm
    1148 then
    1149     RVER=`uname -r`
    1150     if test "x@sh_lkm@" != "x"; then
    1151         if test -d /lib/modules/$RVER; then
    1152             MODDIR="/lib/modules/$RVER"
    1153         elif test -d /lib/modules/misc; then
    1154             MODDIR="/lib/modules/misc"
    1155         elif test -d /lib/modules; then
    1156             MODDIR="/lib/modules/misc"
    1157         fi
    1158         # -- NEW --
    1159         ALLMODS="@sh_lkm@"
    1160         for p in $ALLMODS; do
    1161             test -z "$verbose" || echo "  rm -f ${DESTDIR}${MODDIR}/`echo $p|sed '
    1162 s%samhain%@install_name@%'`"
    1163             rm -f ${DESTDIR}${MODDIR}/`echo $p|sed 's%samhain%@install_name@%'`
    1164         done
    1165     fi
    1166 fi
    1167 
    11681141if test x"${act}" = xuprogram
    11691142then
    1170     PROGRAMS="@setpwd_prg@ @stegin_prg@ @yulectl_prg@ @sh_main_prg@"
     1143    PROGRAMS="@setpwd_prg@ @stegin_prg@ @yulectl_prg@ @sh_main_prg@ @samhainadmin_prg@"
    11711144    for p in $PROGRAMS; do
    1172         test -z "$verbose" || echo "  rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"
    1173         rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`
     1145        test -z "$verbose" || echo "  rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`"
     1146        rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`
    11741147    done
    11751148    test -z "$verbose" || echo $ECHO_N "  ${SH_RMDIR} ${DESTDIR}${sbindir} ... $ECHO_C"
  • trunk/samhain.spec.in

    r418 r481  
    185185fi
    186186
    187 %postun
    188 if [ "$1" = 0 ]; then
    189         # remove any kernel modules that might have been installed
    190         RVER=`uname -r`
    191         MODFILES=`ls /lib/modules/$RVER/@install_name@* 2>/dev/null`
    192         if test "x$MODFILES" = x; then
    193                 :
    194         else
    195                 rm -f /lib/modules/$RVER/@install_name@*
    196         fi
    197 fi
    198187
    199188
     
    203192%dir @mylogdir@
    204193%doc docs/BUGS COPYING docs/Changelog docs/TODO
    205 %doc LICENSE docs/FAQ.html docs/HOWTO* docs/MANUAL-2_3.* docs/README*
     194%doc LICENSE docs/FAQ.html docs/HOWTO* docs/MANUAL-2_4.* docs/README*
    206195@mydataroot@
    207196%if "%{withstg_prg}" == "xsamhain_stealth"
  • trunk/samhainrc.freebsd

    r387 r481  
    370370# SuidCheckQuarantineDelete = yes
    371371
    372 # [Kernel]
    373 ##
    374 ## --- Check for loadable kernel module rootkits (Linux/FreeBSD only)
    375 ##
    376 
    377 ## Switch on/off
    378 #
    379 # KernelCheckActive = True
    380 
    381 ## Check interval (seconds); btw., the check is VERY fast
    382 #
    383 # KernelCheckInterval = 300
    384 
    385 ## Severity
    386 #
    387 # SeverityKernel = crit
    388 
    389372
    390373# [Utmp]
  • trunk/samhainrc.linux

    r387 r481  
    408408# SuidCheckQuarantineDelete = yes
    409409
    410 #[Kernel]
    411 ##
    412 ## --- Check for loadable kernel module rootkits (Linux/FreeBSD only)
    413 ##
    414 
    415 ## Switch on/off
    416 #
    417 # KernelCheckActive = True
    418 
    419 ## Check interval (seconds); btw., the check is VERY fast
    420 #
    421 # KernelCheckInterval = 300
    422 
    423 ## Severity
    424 #
    425 # SeverityKernel = crit
    426 
    427410
    428411# [Utmp]
  • trunk/samhainrc.netbsd

    r387 r481  
    503503#checkmount=/tmp
    504504
    505 #[Kernel]
    506 ##
    507 ## --- Check for loadable kernel module rootkits (Linux/FreeBSD only)
    508 ##
    509 
    510 ## Switch on/off
    511 #
    512 #KernelCheckActive = True
    513 
    514 ## Check interval (seconds); btw., the check is VERY fast
    515 #
    516 #KernelCheckInterval = 300
    517 
    518 ## Severity
    519 #
    520 #SeverityKernel = crit
    521505
    522506
  • trunk/scripts/README

    r121 r481  
    3838   Run 'yuleadmin.pl -h' for usage instructions.
    3939
    40 samhainrc_update.sh
    41 -------------------
    42 
    43    If you are using the --with-kcheck option on Linux, after a kernel
    44    update you need to change some option (addresses of kernel functions)
    45    in the samhainrc configuration file. The correct new addresses must
    46    be looked up in the System.map file
    47 
    48    This script will do this automatically. Run 'samhainrc_update.sh -h'
    49    for usage instructions. You may need to change the location of the
    50    samhainrc file by editing the line 'cfgfile="/etc/samhainrc"'
    51    at the beginning of the script.
    52  
    5340check_samhain.pl
    5441----------------
  • trunk/scripts/redhat_i386.client.spec.in

    r412 r481  
    123123fi
    124124
    125 %postun
    126 if [ "$1" = 0 ]; then
    127         # remove any kernel modules that might have been installed
    128         RVER=`uname -r`
    129         rm -f /lib/modules/$RVER/samhain*
    130 fi
    131125
    132126
     
    136130%dir /var/log
    137131#%doc docs/BUGS COPYING docs/Changelog docs/TODO
    138 #%doc LICENSE docs/HOWTO* docs/MANUAL-2_3.* docs/README*
     132#%doc LICENSE docs/HOWTO* docs/MANUAL-2_4.* docs/README*
    139133/etc
    140134/usr/local/sbin/samhain
  • trunk/scripts/samhain.ebuild.in

    r68 r481  
    6969        dodoc docs/BUGS COPYING docs/Changelog LICENSE docs/README \
    7070              docs/README.UPGRADE docs/sh_mounts.txt docs/sh_userfiles.txt \
    71               docs/MANUAL-2_3.ps docs/MANUAL-2_3.html.tar
     71              docs/MANUAL-2_4.ps docs/MANUAL-2_4.html.tar
    7272
    7373        dohtml docs/HOWTO-client+server.html docs/HOWTO-samhain+GnuPG.html \
  • trunk/scripts/samhain.spec.in

    r412 r481  
    109109fi
    110110
    111 %postun
    112 if [ "$1" = 0 ]; then
    113         # remove any kernel modules that might have been installed
    114         RVER=`uname -r`
    115         rm -f /lib/modules/$RVER/samhain*
    116 fi
    117 
    118111
    119112%files
     
    122115%dir %{_localstatedir}/log
    123116%doc docs/BUGS COPYING docs/Changelog docs/TODO
    124 %doc LICENSE docs/HOWTO* docs/MANUAL-2_3.* docs/README*
     117%doc LICENSE docs/HOWTO* docs/MANUAL-2_4.* docs/README*
    125118%{_localstatedir}/lib/%{name}
    126119%{_sbindir}/%{name}
  • trunk/scripts/samhainadmin.pl.in

    r415 r481  
    156156    print "    Set the passphrase for gpg. By default, gpg will ask.\n\n";
    157157
    158     print "  -s secretkeyring --secretkeyring secretkeyring\n";
    159     print "    Select an alternate secret keyring for gpg.\n";
    160     print "    Will use '$ENV{'HOME'}/.gnupg/secring.gpg' by default.\n\n";
     158    print "  -s gnupg_homedir --secretkeyring gnupg_homedir\n";
     159    print "    Select an alternate gpg homedirectory to locate the secret keyring.\n";
     160    print "    Will use '$ENV{'HOME'}/.gnupg/' by default.\n\n";
     161
     162    print "  -k keyid      --keyid keyid\n";
     163    print "   Select the keyid to use for signing.\n\n";
    161164
    162165    print "  -l            --list\n";
     
    570573            'p|passphrase=s',
    571574            's|secretkeyring=s',
     575            'k|keyid=s',
    572576            'create-cfgfile',  # -m F
    573577            'print-cfgfile',   # -m f
     
    584588}
    585589
     590if (defined($opts{'k'})) {
     591    $TARGETKEYID = $opts{'k'};
     592    $KEYTAG = "--default-key";
     593}
    586594if (defined($opts{'c'})) {
    587595    $cfgfile = $opts{'c'};
  • trunk/sql_init/samhain.mysql.init

    r392 r481  
    8787        igroup_old    BIGINT UNSIGNED,
    8888        igroup_new    BIGINT UNSIGNED,
     89        checkflags_old    BIGINT UNSIGNED,
     90        checkflags_new    BIGINT UNSIGNED,
    8991       
    9092
  • trunk/sql_init/samhain.oracle.init

    r407 r481  
    7474        igroup_old    NUMBER(20),
    7575        igroup_new    NUMBER(20),
     76        checkflags_old    NUMBER(20),
     77        checkflags_new    NUMBER(20),
    7678        acl_old       VARCHAR2(4000),
    7779        acl_new       VARCHAR2(4000)
  • trunk/sql_init/samhain.postgres.init

    r392 r481  
    8181        igroup_old    NUMERIC(20),
    8282        igroup_new    NUMERIC(20),
     83        checkflags_old    NUMERIC(20),
     84        checkflags_new    NUMERIC(20),
    8385                 
    8486        acl_old       TEXT,
  • trunk/src/cutest_sh_tiger0.c

    r444 r481  
    2828  if (skey != NULL)
    2929    {
    30       skey->mlock_failed = SL_FALSE;
     30      skey->mlock_failed = S_FALSE;
    3131      skey->rngI         = BAD;
    3232      /* properly initialized later
  • trunk/src/cutest_sh_unix.c

    r474 r481  
    1414  int j, i;
    1515  int sum;
     16#ifndef USE_SYSTEM_MALLOC
    1617  int i_malloc =  malloc_count;
     18#endif
    1719
    1820  char * buf;
     
    3537  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
    3638
     39#ifndef USE_SYSTEM_MALLOC
    3740  i_malloc = malloc_count;
     41#endif
    3842
    3943  for (j = 0; j < 64; ++j)
     
    6064  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
    6165
     66#ifndef USE_SYSTEM_MALLOC
    6267  i_malloc = malloc_count;
     68#endif
    6369
    6470  for (j = 0; j < 64; ++j)
     
    97103    }
    98104
     105#ifndef USE_SYSTEM_MALLOC
    99106  i_malloc =  malloc_count;
     107#endif
    100108
    101109  for (j = 0; j < nalloc; ++j)
     
    122130  for (j = 0; j < 32; ++j)
    123131    {
     132#ifndef USE_SYSTEM_MALLOC
    124133      i_malloc =  malloc_count;
     134#endif
    125135      buf = malloc((j+1) * 1024 * 1024);
    126136      CuAssertPtrNotNull(tc, buf);
  • trunk/src/cutest_sh_utils.c

    r444 r481  
    531531}
    532532
    533 
  • trunk/src/cutest_zAVLTree.c

    r452 r481  
    2121static zAVLKey ztest_intkey(void const *item)
    2222{
    23   return (&((struct ztest *)item)->iname);
     23  return (&((const struct ztest *)item)->iname);
    2424}
    2525
  • trunk/src/dnmalloc.c

    r383 r481  
    220220#ifdef linux
    221221#define HAVE_MREMAP 1
    222 #define _GNU_SOURCE
     222#define _GNU_SOURCE 1
    223223#else
    224224#define HAVE_MREMAP 0
     
    310310  char * i3 = "): ";
    311311  char * i5 = "\n";
    312   int   res = 0;
    313 
    314   iov[0].iov_base = i1;               iov[0].iov_len = strlen(i1);
    315   iov[1].iov_base = (char*) file;     iov[1].iov_len = strlen(file);
    316   iov[2].iov_base = i3;               iov[2].iov_len = strlen(i3);
    317   iov[3].iov_base = (char*) error;    iov[3].iov_len = strlen(error);
    318   iov[4].iov_base = i5;               iov[4].iov_len = strlen(i5);
     312  int    res = 0;
     313  char   ifile[128];
     314  char   ierr[128];
     315
     316  strncpy(ifile, file, sizeof(ifile)); ifile[sizeof(ifile)-1] = '\0';
     317  strncpy(ierr, error, sizeof(ierr));  ierr[sizeof(ierr)-1]   = '\0';
     318
     319  iov[0].iov_base = i1;     iov[0].iov_len = strlen(i1);
     320  iov[1].iov_base = ifile;  iov[1].iov_len = strlen(ifile);
     321  iov[2].iov_base = i3;     iov[2].iov_len = strlen(i3);
     322  iov[3].iov_base = ierr;   iov[3].iov_len = strlen(ierr);
     323  iov[4].iov_base = i5;     iov[4].iov_len = strlen(i5);
    319324  do {
    320325    res = writev(STDERR_FILENO, iov, 5);
     
    343348
    344349static assert_handler_tp *assert_handler = NULL;
     350#ifndef NDEBUG
    345351#define NDEBUG
     352#endif
    346353#define assert(x) ((void)0)
    347354
     
    37643771    } /* not extended previous region */
    37653772   
    3766     /* Update statistics */ /* FIXME check this */
     3773    /* Update statistics */
    37673774    sum = av->sbrked_mem;
    37683775    if (sum > (CHUNK_SIZE_T)(av->max_sbrked_mem))
  • trunk/src/rijndael-alg-fst.c

    r440 r481  
     1/*      $NetBSD: rijndael-alg-fst.c,v 1.7 2005/12/11 12:20:52 christos Exp $    */
     2/*      $KAME: rijndael-alg-fst.c,v 1.10 2003/07/15 10:47:16 itojun Exp $       */
     3/**
     4 * rijndael-alg-fst.c
     5 *
     6 * @version 3.0 (December 2000)
     7 *
     8 * Optimised ANSI C code for the Rijndael cipher (now AES)
     9 *
     10 * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
     11 * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
     12 * @author Paulo Barreto <paulo.barreto@terra.com.br>
     13 *
     14 * This code is hereby placed in the public domain.
     15 *
     16 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
     17 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
     20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27 */
     28
     29#include "config_xor.h"
     30
     31#include <sys/types.h>
     32#include <string.h>
     33
     34#ifdef SH_ENCRYPT
     35
     36typedef unsigned char u8;
     37#if defined(HAVE_INT_32)
     38typedef unsigned int u32;
     39#elif defined(HAVE_LONG_32)
     40typedef unsigned long u32;
     41#elif defined(HAVE_SHORT_32)
     42typedef unsigned short u32;
     43#else
     44#error "No 32 bit integer type found"
     45#endif
     46
     47#include "rijndael-alg-fst.h"
     48
     49#define FULL_UNROLL 1
    150/*
    2  * rijndael-alg-fst.c   v2.3   April '2000
     51Te0[x] = S [x].[02, 01, 01, 03];
     52Te1[x] = S [x].[03, 02, 01, 01];
     53Te2[x] = S [x].[01, 03, 02, 01];
     54Te3[x] = S [x].[01, 01, 03, 02];
     55Te4[x] = S [x].[01, 01, 01, 01];
     56
     57Td0[x] = Si[x].[0e, 09, 0d, 0b];
     58Td1[x] = Si[x].[0b, 0e, 09, 0d];
     59Td2[x] = Si[x].[0d, 0b, 0e, 09];
     60Td3[x] = Si[x].[09, 0d, 0b, 0e];
     61Td4[x] = Si[x].[01, 01, 01, 01];
     62*/
     63
     64static const u32 Te0[256] = {
     65    0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
     66    0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
     67    0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
     68    0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
     69    0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
     70    0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
     71    0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
     72    0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
     73    0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
     74    0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
     75    0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
     76    0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
     77    0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
     78    0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
     79    0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
     80    0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
     81    0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
     82    0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
     83    0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
     84    0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
     85    0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
     86    0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
     87    0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
     88    0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
     89    0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
     90    0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
     91    0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
     92    0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
     93    0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
     94    0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
     95    0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
     96    0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
     97    0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
     98    0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
     99    0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
     100    0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
     101    0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
     102    0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
     103    0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
     104    0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
     105    0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
     106    0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
     107    0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
     108    0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
     109    0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
     110    0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
     111    0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
     112    0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
     113    0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
     114    0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
     115    0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
     116    0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
     117    0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
     118    0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
     119    0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
     120    0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
     121    0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
     122    0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
     123    0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
     124    0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
     125    0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
     126    0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
     127    0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
     128    0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
     129};
     130static const u32 Te1[256] = {
     131    0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
     132    0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
     133    0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
     134    0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
     135    0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
     136    0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
     137    0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
     138    0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
     139    0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
     140    0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
     141    0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
     142    0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
     143    0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
     144    0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
     145    0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
     146    0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
     147    0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
     148    0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
     149    0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
     150    0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
     151    0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
     152    0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
     153    0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
     154    0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
     155    0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
     156    0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
     157    0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
     158    0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
     159    0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
     160    0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
     161    0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
     162    0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
     163    0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
     164    0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
     165    0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
     166    0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
     167    0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
     168    0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
     169    0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
     170    0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
     171    0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
     172    0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
     173    0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
     174    0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
     175    0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
     176    0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
     177    0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
     178    0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
     179    0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
     180    0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
     181    0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
     182    0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
     183    0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
     184    0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
     185    0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
     186    0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
     187    0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
     188    0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
     189    0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
     190    0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
     191    0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
     192    0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
     193    0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
     194    0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
     195};
     196static const u32 Te2[256] = {
     197    0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
     198    0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
     199    0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
     200    0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
     201    0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
     202    0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
     203    0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
     204    0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
     205    0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
     206    0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
     207    0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
     208    0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
     209    0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
     210    0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
     211    0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
     212    0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
     213    0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
     214    0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
     215    0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
     216    0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
     217    0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
     218    0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
     219    0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
     220    0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
     221    0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
     222    0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
     223    0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
     224    0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
     225    0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
     226    0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
     227    0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
     228    0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
     229    0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
     230    0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
     231    0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
     232    0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
     233    0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
     234    0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
     235    0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
     236    0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
     237    0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
     238    0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
     239    0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
     240    0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
     241    0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
     242    0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
     243    0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
     244    0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
     245    0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
     246    0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
     247    0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
     248    0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
     249    0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
     250    0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
     251    0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
     252    0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
     253    0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
     254    0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
     255    0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
     256    0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
     257    0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
     258    0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
     259    0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
     260    0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
     261};
     262static const u32 Te3[256] = {
     263
     264    0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
     265    0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
     266    0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
     267    0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
     268    0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
     269    0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
     270    0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
     271    0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
     272    0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
     273    0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
     274    0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
     275    0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
     276    0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
     277    0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
     278    0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
     279    0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
     280    0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
     281    0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
     282    0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
     283    0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
     284    0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
     285    0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
     286    0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
     287    0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
     288    0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
     289    0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
     290    0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
     291    0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
     292    0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
     293    0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
     294    0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
     295    0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
     296    0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
     297    0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
     298    0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
     299    0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
     300    0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
     301    0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
     302    0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
     303    0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
     304    0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
     305    0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
     306    0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
     307    0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
     308    0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
     309    0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
     310    0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
     311    0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
     312    0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
     313    0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
     314    0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
     315    0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
     316    0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
     317    0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
     318    0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
     319    0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
     320    0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
     321    0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
     322    0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
     323    0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
     324    0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
     325    0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
     326    0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
     327    0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
     328};
     329static const u32 Te4[256] = {
     330    0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
     331    0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
     332    0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
     333    0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
     334    0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
     335    0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
     336    0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
     337    0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
     338    0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
     339    0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
     340    0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
     341    0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
     342    0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
     343    0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
     344    0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
     345    0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
     346    0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
     347    0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
     348    0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
     349    0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
     350    0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
     351    0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
     352    0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
     353    0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
     354    0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
     355    0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
     356    0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
     357    0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
     358    0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
     359    0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
     360    0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
     361    0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
     362    0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
     363    0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
     364    0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
     365    0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
     366    0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
     367    0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
     368    0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
     369    0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
     370    0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
     371    0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
     372    0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
     373    0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
     374    0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
     375    0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
     376    0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
     377    0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
     378    0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
     379    0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
     380    0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
     381    0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
     382    0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
     383    0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
     384    0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
     385    0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
     386    0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
     387    0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
     388    0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
     389    0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
     390    0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
     391    0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
     392    0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
     393    0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
     394};
     395static const u32 Td0[256] = {
     396    0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
     397    0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
     398    0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
     399    0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
     400    0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
     401    0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
     402    0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
     403    0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
     404    0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
     405    0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
     406    0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
     407    0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
     408    0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
     409    0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
     410    0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
     411    0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
     412    0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
     413    0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
     414    0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
     415    0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
     416    0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
     417    0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
     418    0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
     419    0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
     420    0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
     421    0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
     422    0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
     423    0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
     424    0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
     425    0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
     426    0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
     427    0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
     428    0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
     429    0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
     430    0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
     431    0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
     432    0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
     433    0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
     434    0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
     435    0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
     436    0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
     437    0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
     438    0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
     439    0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
     440    0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
     441    0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
     442    0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
     443    0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
     444    0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
     445    0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
     446    0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
     447    0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
     448    0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
     449    0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
     450    0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
     451    0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
     452    0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
     453    0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
     454    0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
     455    0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
     456    0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
     457    0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
     458    0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
     459    0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
     460};
     461static const u32 Td1[256] = {
     462    0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
     463    0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
     464    0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
     465    0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
     466    0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
     467    0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
     468    0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
     469    0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
     470    0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
     471    0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
     472    0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
     473    0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
     474    0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
     475    0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
     476    0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
     477    0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
     478    0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
     479    0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
     480    0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
     481    0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
     482    0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
     483    0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
     484    0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
     485    0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
     486    0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
     487    0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
     488    0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
     489    0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
     490    0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
     491    0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
     492    0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
     493    0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
     494    0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
     495    0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
     496    0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
     497    0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
     498    0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
     499    0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
     500    0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
     501    0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
     502    0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
     503    0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
     504    0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
     505    0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
     506    0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
     507    0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
     508    0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
     509    0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
     510    0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
     511    0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
     512    0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
     513    0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
     514    0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
     515    0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
     516    0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
     517    0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
     518    0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
     519    0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
     520    0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
     521    0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
     522    0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
     523    0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
     524    0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
     525    0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
     526};
     527static const u32 Td2[256] = {
     528    0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
     529    0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
     530    0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
     531    0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
     532    0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
     533    0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
     534    0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
     535    0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
     536    0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
     537    0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
     538    0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
     539    0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
     540    0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
     541    0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
     542    0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
     543    0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
     544    0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
     545    0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
     546    0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
     547    0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
     548
     549    0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
     550    0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
     551    0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
     552    0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
     553    0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
     554    0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
     555    0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
     556    0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
     557    0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
     558    0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
     559    0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
     560    0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
     561    0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
     562    0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
     563    0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
     564    0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
     565    0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
     566    0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
     567    0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
     568    0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
     569    0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
     570    0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
     571    0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
     572    0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
     573    0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
     574    0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
     575    0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
     576    0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
     577    0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
     578    0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
     579    0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
     580    0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
     581    0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
     582    0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
     583    0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
     584    0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
     585    0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
     586    0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
     587    0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
     588    0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
     589    0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
     590    0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
     591    0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
     592    0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
     593};
     594static const u32 Td3[256] = {
     595    0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
     596    0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
     597    0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
     598    0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
     599    0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
     600    0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
     601    0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
     602    0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
     603    0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
     604    0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
     605    0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
     606    0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
     607    0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
     608    0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
     609    0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
     610    0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
     611    0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
     612    0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
     613    0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
     614    0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
     615    0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
     616    0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
     617    0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
     618    0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
     619    0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
     620    0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
     621    0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
     622    0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
     623    0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
     624    0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
     625    0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
     626    0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
     627    0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
     628    0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
     629    0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
     630    0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
     631    0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
     632    0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
     633    0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
     634    0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
     635    0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
     636    0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
     637    0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
     638    0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
     639    0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
     640    0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
     641    0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
     642    0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
     643    0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
     644    0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
     645    0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
     646    0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
     647    0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
     648    0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
     649    0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
     650    0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
     651    0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
     652    0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
     653    0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
     654    0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
     655    0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
     656    0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
     657    0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
     658    0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
     659};
     660static const u32 Td4[256] = {
     661    0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
     662    0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
     663    0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
     664    0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
     665    0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
     666    0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
     667    0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
     668    0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
     669    0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
     670    0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
     671    0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
     672    0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
     673    0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
     674    0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
     675    0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
     676    0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
     677    0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
     678    0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
     679    0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
     680    0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
     681    0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
     682    0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
     683    0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
     684    0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
     685    0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
     686    0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
     687    0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
     688    0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
     689    0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
     690    0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
     691    0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
     692    0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
     693    0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
     694    0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
     695    0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
     696    0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
     697    0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
     698    0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
     699    0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
     700    0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
     701    0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
     702    0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
     703    0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
     704    0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
     705    0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
     706    0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
     707    0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
     708    0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,