Changeset 147


Ignore:
Timestamp:
Nov 26, 2007, 8:34:29 PM (11 years ago)
Author:
katerina
Message:

Fix regression in the seeding routine of the PRNG

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r144 r147  
    16501650sh_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_static.h $(srcinc)/sh_tools.h  
    16511651sh_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  
    1652 sh_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  
     1652sh_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  
    16531653sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.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_mail.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  
    16541654sh_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  
  • trunk/configure.ac

    r145 r147  
    1313dnl start 
    1414dnl 
    15 AM_INIT_AUTOMAKE(samhain, 2.4.0a) 
     15AM_INIT_AUTOMAKE(samhain, 2.4.1) 
    1616AC_CANONICAL_HOST 
    1717 
  • trunk/depend.dep

    r144 r147  
    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_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  
    18 sh_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  
     18sh_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)/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_mail.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  
    2020sh_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  
  • trunk/depend.sum

    r146 r147  
    1  
     11541314115 
  • trunk/docs/Changelog

    r146 r147  
    112.4.1: 
     2        * security fix: regression in the seeding routine for the PRNG  
     3          (detected by C. Mueller) 
     4        * regression test added for PRNG seeding routine 
    25        * fix problem with PCI ROM check (spurious messages about modified 
    36          timestamps, reported by S. Clormann) 
  • trunk/src/sh_entropy.c

    r138 r147  
    295295      if (0 == sh_unix_device_readable(fd2))  
    296296        { 
    297           m_count = sl_read_timeout_fd(fd2, &nbuf, nbytes,  
     297          m_count = sl_read_timeout_fd(fd2, nbuf, nbytes,  
    298298                                       timeout_val, SL_FALSE); 
    299299          if (m_count < 0) 
     
    387387      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); 
    388388      memset (keybuf, '\0', KEY_BYT); 
     389      memset (kbuf,   '\0', sizeof(kbuf)); 
    389390       
    390391      SL_RETURN(0, _("sh_entropy")); 
     
    960961#endif 
    961962 
    962  
    963  
    964  
    965  
    966  
    967  
     963#ifdef SH_CUTEST 
     964#include "CuTest.h" 
     965 
     966void Test_entropy (CuTest *tc) 
     967{ 
     968  char                 bufx[9 * sizeof(UINT32) + 1]; 
     969  char                 bufy[9 * sizeof(UINT32) + 1]; 
     970  int                  status; 
     971 
     972  memset(skey->poolv, '\0', KEY_BYT); 
     973 
     974  status = sh_entropy (24, bufx); 
     975  CuAssertTrue(tc, 0 == status); 
     976 
     977  memset(skey->poolv, '\0', KEY_BYT); 
     978 
     979  status = sh_entropy (24, bufy); 
     980  CuAssertTrue(tc, 0 == status); 
     981 
     982  CuAssertTrue(tc, 0 != memcmp(bufx, bufy, 24)); 
     983} 
     984#endif 
     985 
     986 
     987 
     988 
     989 
     990 
     991 
     992 
  • trunk/test/testcompile.sh

    r145 r147  
    414414        # test standalone compilation 
    415415        # 
    416         TEST="${S}standalone w/o mail${E}" 
    417         # 
    418         if test -r "Makefile"; then 
    419                 $MAKE clean 
    420         fi 
    421         # 
    422         ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
     416        TEST="${S}standalone w/o mail w/unix_rnd${E}" 
     417        # 
     418        if test -r "Makefile"; then 
     419                $MAKE clean 
     420        fi 
     421        # 
     422        ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-rnd=unix > /dev/null 2>> test_log   
    423423        # 
    424424        let "num = num + 1" >/dev/null 
Note: See TracChangeset for help on using the changeset viewer.