Changeset 225


Ignore:
Timestamp:
Mar 4, 2009, 11:39:50 PM (16 years ago)
Author:
katerina
Message:

Fix for ticket #150 (flawed input verification in SRP). Release 2.5.4

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r215 r225  
    16741674sh_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
    16751675sh_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
    1676 sh_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
     1676sh_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
    16771677sh_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
    16781678sh_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)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h
  • trunk/configure.ac

    r221 r225  
    1212dnl start
    1313dnl
    14 AM_INIT_AUTOMAKE(samhain, 2.5.3)
     14AM_INIT_AUTOMAKE(samhain, 2.5.4)
    1515AC_DEFINE([SAMHAIN], 1, [Application is samhain])
    1616AC_CANONICAL_HOST
  • trunk/depend.dep

    r215 r225  
    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
    2323sh_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
    24 sh_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
     24sh_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
    2525sh_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
    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)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h
  • trunk/depend.sum

    r215 r225  
    1 3041707433
     12676345821
  • trunk/docs/Changelog

    r223 r225  
    112.5.4:
     2        * fix for incorrect input check in SRP implementation (discovered
     3          by Thomas Ptacek)
    24        * option KernelCheckPCI to switch off check of PCI expansion ROMs
    35       
  • trunk/src/sh_forward.c

    r219 r225  
    12001200                      /* --- Now send H(A,B,H(Sc)) and check. ---
    12011201                       */
    1202                       if (foo_Sc != NULL)
     1202                      if (foo_Sc != NULL && 0 == sh_srp_check_zero (foo_Sc))
    12031203                        {
    12041204                          sh_srp_M(foo_A,
     
    41574157                                       conn->A,
    41584158                                       conn->client_entry->verifier);
    4159                   if (foo_Ss == NULL)
     4159
     4160                  if (foo_Ss == NULL || 0 != sh_srp_check_zero (foo_Ss))
    41604161                    {
    41614162                      status_update (conn->client_entry, CLT_FAILED);
  • trunk/src/sh_srp.c

    r138 r225  
    388388  if (res != BIG_OK)             val = (-1);
    389389  else if (0 != big_zerop(&AB) ) val = (-1); /* 0 != (sign == 0) */
     390  else if (0 != big_zerop(&r) )  val = (-1); /* 0 != (sign == 0) */
    390391  else                           val =    0;
    391392
     
    711712
    712713
    713 
    714 
     714#ifdef SH_CUTEST
     715#include "CuTest.h"
     716
     717void Test_srp (CuTest *tc)
     718{
     719#if defined(USE_SRP_PROTOCOL) && (defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER))
     720
     721  int result;
     722  char     modulus[80*4];
     723  bignum   a, b, c;
     724  bigerr_t res;
     725  char    *str = NULL;
     726
     727  res = sh_srp_init();
     728  CuAssertTrue(tc, res == 0);
     729
     730  (void) sl_strlcpy(modulus, SRP_MODULUS_1024_1, sizeof(modulus));
     731  (void) sl_strlcat(modulus, SRP_MODULUS_1024_2, sizeof(modulus));
     732  (void) sl_strlcat(modulus, SRP_MODULUS_1024_3, sizeof(modulus));
     733  (void) sl_strlcat(modulus, SRP_MODULUS_1024_4, sizeof(modulus));
     734
     735  res = big_create(&a);
     736  CuAssertTrue(tc, res == BIG_OK);
     737
     738  /* Check plain zero
     739   */
     740  result = sh_srp_check_zero ("0");
     741  CuAssertTrue(tc, result != 0);
     742 
     743  res = big_set_string ("0",  16, &a);
     744  CuAssertTrue(tc, res == BIG_OK);
     745
     746  result = sh_srp_check_zero (big_string(&a, 16));
     747  CuAssertTrue(tc, result != 0);
     748
     749  /* Check modulus (equals 0 % M)
     750   */
     751  result = sh_srp_check_zero (modulus);
     752  CuAssertTrue(tc, result != 0);
     753
     754  res = big_set_string (modulus,  16, &a);
     755  CuAssertTrue(tc, res == BIG_OK);
     756
     757  result = sh_srp_check_zero (big_string(&a, 16));
     758  CuAssertTrue(tc, result != 0);
     759
     760  /* Check non-zero
     761   */
     762  modulus[0] = 'a';
     763
     764  result = sh_srp_check_zero (modulus);
     765  CuAssertTrue(tc, result == 0);
     766
     767  res = big_set_string (modulus,  16, &a);
     768  CuAssertTrue(tc, res == BIG_OK);
     769
     770  result = sh_srp_check_zero (big_string(&a, 16));
     771  CuAssertTrue(tc, result == 0);
     772
     773  modulus[0] = 'f';
     774
     775  /* Check multiple of modulus
     776   */
     777  res = big_set_string (modulus,  16, &a);
     778  CuAssertTrue(tc, res == BIG_OK);
     779
     780  res = big_create(&b);
     781  CuAssertTrue(tc, res == BIG_OK);
     782
     783  res = big_create(&c);
     784  CuAssertTrue(tc, res == BIG_OK);
     785
     786  res = big_set_string ("deadbeef", 16, &b);
     787  CuAssertTrue(tc, res == BIG_OK);
     788
     789  res = big_mul (&a, &b, &c);
     790  CuAssertTrue(tc, res == BIG_OK);
     791
     792  str = strdup(big_string (&c, 16));
     793  CuAssertPtrNotNull(tc, str);
     794
     795  result = sh_srp_check_zero (str);
     796  CuAssertTrue(tc, result != 0);
     797
     798#else
     799  (void) tc; /* fix compiler warning */
     800#endif
     801  return;
     802}
     803#endif
     804
     805
     806
  • trunk/test/testhash.sh

    r223 r225  
    3737        fi
    3838        #
    39         ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug 
     39        ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug
    4040        #
    4141        fail=0
Note: See TracChangeset for help on using the changeset viewer.