]> www.vanbest.org Git - sasc-ng.git/commitdiff
allways init random generator
authorleslie <unknown>
Mon, 28 Jul 2008 02:12:04 +0000 (10:12 +0800)
committerleslie <unknown>
Mon, 28 Jul 2008 02:12:04 +0000 (10:12 +0800)
sc.c
systems/cardclient/newcamd.c

diff --git a/sc.c b/sc.c
index b762745b71584b44630c3fe3478f11c659faa91a..e799d178e976d75d770fe42ec0ce162db6dc3979 100644 (file)
--- a/sc.c
+++ b/sc.c
@@ -1012,6 +1012,7 @@ bool cSoftCAM::Load(const char *cfgdir)
   if(Feature.KeyFile() && keys.Count()<1)
     PRINTF(L_GEN_ERROR,"no keys loaded for softcam!");
   if(!cSystems::Init(cfgdir)) return false;
+  srand(time(0));
   return true;
 }
 
index a53e861d03fba902057da53a3c1556f8edc818ec..87a3c641c8eae9cd944e79959564cc345c598a9e 100644 (file)
@@ -95,7 +95,6 @@ int cTripleDes::PadMessage(unsigned char *data, int len)
     return -1;
     }
 
-  srand(time(NULL)); // make sure the random generator is initialized
   DES_random_key((DES_cblock *)padBytes);
   memcpy(data+len,padBytes,noPadBytes); len+=noPadBytes;
   data[len]=XorSum(data+2,len-2);