]> www.vanbest.org Git - sasc-ng.git/commitdiff
remove sec. loader code / cleanup. Task done ;)
authormirv <unknown>
Fri, 4 Jan 2008 18:35:55 +0000 (19:35 +0100)
committermirv <unknown>
Fri, 4 Jan 2008 18:35:55 +0000 (19:35 +0100)
data.c
data.h
smartcard.c
system-common.c
systems/conax/conax.c
systems/constcw/constcw.c
systems/cryptoworks/cryptoworks.c
systems/nagra/nagra.c
systems/seca/seca.c
systems/viaccess/viaccess.c

diff --git a/data.c b/data.c
index 7427078449bc0b77d2402cf191363d6ac8ca5227..52983dfb83c4bacdeac543b997faf7aeedb45458 100644 (file)
--- a/data.c
+++ b/data.c
@@ -510,32 +510,6 @@ void cStructLoaders::Purge(void)
     }
 }
 
-// -- cConfRead ----------------------------------------------------------------
-
-bool cConfRead::ConfRead(const char *type, const char *filename, bool missingok)
-{
-  bool res=false;
-  FILE *f=fopen(filename,"r");
-  if(f) {
-    res=true;
-    PRINTF(L_GEN_INFO,"loading %s from %s",type,filename);
-    char buff[1024];
-    while(fgets(buff,sizeof(buff),f)) {
-      if(!index(buff,'\n') && !feof(f))
-        PRINTF(L_GEN_ERROR,"confread %s fgets readbuffer overflow",type);
-      char *line=skipspace(stripspace(buff));
-      if(line[0]==0 || line[0]==';' || line[0]=='#') continue; // skip empty & comment lines
-      if(!ParseLine(line,false)) {
-        PRINTF(L_GEN_ERROR,"file '%s' has error in line '%s'",filename,buff);
-        res=false;
-        }
-      }
-    fclose(f);
-    }
-  else if(!missingok) PRINTF(L_GEN_ERROR,"Failed to open file '%s': %s",filename,strerror(errno));
-  return res;
-}
-
 // -- cPid ---------------------------------------------------------------------
 
 cPid::cPid(int Pid, int Section, int Mask, int Mode)
@@ -677,11 +651,6 @@ cString cPlainKey::ToString(bool hide)
   return cString::sprintf(hide ? "%c %.*X %s %.4s..." : "%c %.*X %s %s",type,IdSize(),id,*PrintKeyNr(),*Print());
 }
 
-void cPlainKey::FormatError(const char *type, const char *sline)
-{
-  PRINTF(L_GEN_WARN,"%s key: bad format '%.15s%s'\n",type,sline,(strlen(sline)>15)?"...":"");
-}
-
 // -- cMutableKey --------------------------------------------------------------
 
 cMutableKey::cMutableKey(bool Super)
diff --git a/data.h b/data.h
index 1e7a879e4ba937ba41c39b90773d1a9a41d97b4b..ff5e37890dd8edaa31357e52d3b126ef73ab7f60 100644 (file)
--- a/data.h
+++ b/data.h
@@ -191,15 +191,6 @@ public:
 
 // ----------------------------------------------------------------
 
-class cConfRead {
-public:
-  virtual ~cConfRead() {}
-  bool ConfRead(const char *type, const char *filename, bool missingok=false);
-  virtual bool ParseLine(const char *line, bool fromCache)=0;
-  };
-
-// ----------------------------------------------------------------
-
 class cPid : public cSimpleItem {
 public:
   int pid, sct, mask, mode;
@@ -266,7 +257,6 @@ protected:
   virtual int IdSize(void);
   virtual cString Print(void)=0;
   virtual cString PrintKeyNr(void);
-  void FormatError(const char *type, const char *sline);
 public:
   int type, id, keynr;
   //
index 14cd9be24ed360c12ba960c4849ee2e2ee73e0b2..957c0cf21051863bdbc4f69e220a58225ab40378 100644 (file)
@@ -1107,7 +1107,7 @@ static const char *serModes[] = { 0,"8e2","8o2","8n2" };
 
 cSmartCards::cSmartCards(void)
 :cThread("SmartcardWatcher")
-,cStructList<cSmartCardData>("smartcard data",DATAFILE,SL_MISSINGOK|SL_WATCH)
+,cStructList<cSmartCardData>("smartcard data",DATAFILE,SL_MISSINGOK|SL_WATCH|SL_VERBOSE)
 {
   for(int i=0 ; i<MAX_PORTS ; i++) ports[i].Serial=0;
   firstRun=true;
index eec12fe98fcc706892bd5ea726378f7c6afbc966..fdaec09afae702705896f8257e6a233bd79a48a8 100644 (file)
@@ -153,7 +153,6 @@ cPlainKeyStd::cPlainKeyStd(bool Super)
 bool cPlainKeyStd::Parse(const char *line)
 {
   unsigned char sid[3], skeynr, skey[PLAINLEN_STD];
-  const char *sline=line;
   int len;
   if(GetChar(line,&type,1) && (len=GetHex(line,sid,3,false)) &&
      GetHex(line,&skeynr,1) && GetHex(line,skey,PLAINLEN_STD)) {
@@ -161,7 +160,6 @@ bool cPlainKeyStd::Parse(const char *line)
     SetBinKey(skey,PLAINLEN_STD);
     return true;
     }
-  FormatError("standard",sline);
   return false;
 }
 
index abf7e4784473ee573cb8baf7b9133cb5614deaab..390760b26b24aee1339015d0c7e4bfa88a1a975a 100644 (file)
@@ -150,14 +150,12 @@ cPlainKeyConax::cPlainKeyConax(bool Super)
 bool cPlainKeyConax::Parse(const char *line)
 {
   unsigned char sid, skey[PLAINLEN_CONAX];
-  const char *sline=line;
   if(GetChar(line,&type,1) && GetHex(line,&sid,1) &&
      GetChar(line,&keynr,1) && GetHex(line,skey,PLAINLEN_CONAX)) {
     type=toupper(type); keynr=toupper(keynr); id=sid;
     SetBinKey(skey,PLAINLEN_CONAX);
     return true;
     }
-  FormatError("conax",sline);
   return false;
 }
 
index 1a5fc67716bf7c38556cc0dec5fd6fed8bc618fe..56ddd46f9a707a1ec2a347a9216050c95de70dd4 100644 (file)
@@ -66,7 +66,6 @@ bool cPlainKeyConstCw::Matches(const cEcmInfo *ecm)
 bool cPlainKeyConstCw::Parse(const char *line)
 {
   unsigned char caid[2], skey[PLAINLEN_CW];
-  const char *sline=line;
   if(GetChar(line,&type,1) && GetHex(line,caid,2)) {
     int num;
     char srcBuf[16];
@@ -85,7 +84,6 @@ bool cPlainKeyConstCw::Parse(const char *line)
         }
       }
     }
-  FormatError("constcw",sline);
   return false;
 }
 
index f0b92051c00666c63e2adc133ee7d0a2d53e1754..1fc0d6b5b644b8fdc27e5f2998dc231e7217b105 100644 (file)
@@ -359,7 +359,6 @@ bool cPlainKeyCryptoworks::IsBNKey(void) const
 
 bool cPlainKeyCryptoworks::Parse(const char *line)
 {
-  const char *sline=line;
   unsigned char sid[2], sprov;
   if(GetChar(line,&type,1) && GetHex(line,sid,2) && GetHex(line,&sprov,1)) {
     int keylen, prov;
@@ -386,7 +385,6 @@ bool cPlainKeyCryptoworks::Parse(const char *line)
         }
       }
     }
-  FormatError("cryptoworks",sline);
   return false;
 }
 
index 9844a829aa8572bbdd5d30dbe7b054cc46677ab6..09fa8849d381dc0416b5f77e4f92a1dfc1051630 100644 (file)
@@ -101,7 +101,6 @@ void cPlainKeyNagra::GetTagDef(int nr, int &romnr, int &pk, int &keytype)
 bool cPlainKeyNagra::Parse(const char *line)
 {
   unsigned char sid[2];
-  const char *sline=line;
   int len;
   if(GetChar(line,&type,1) && (len=GetHex(line,sid,2,false))) {
     type=toupper(type); id=Bin2Int(sid,len); 
@@ -172,7 +171,6 @@ bool cPlainKeyNagra::Parse(const char *line)
       return true;
       }
     }
-  FormatError("nagra",sline);
   return false;
 }
 
index b91650d1bd01bc0771ae38c7c4cfe37caf124726..5f51736568bc1d2acf9b09765b425f2292b29e44 100644 (file)
@@ -95,7 +95,6 @@ bool cPlainKeySeca::IsBNKey(void) const
 bool cPlainKeySeca::Parse(const char *line)
 {
   unsigned char sid[2];
-  const char *sline=line;
   int len;
   if(GetChar(line,&type,1) && (len=GetHex(line,sid,2,false))) {
     type=toupper(type); id=Bin2Int(sid,len);
@@ -143,7 +142,6 @@ bool cPlainKeySeca::Parse(const char *line)
         }
       }
     }
-  FormatError("seca",sline);
   return false;
 }
 
index d083894d24579a1a1a7ffb1faada09665ec9e8c9..a0f5adca7391172f8d2057b8396ce6029cd9db34 100644 (file)
@@ -80,7 +80,6 @@ bool cPlainKeyVia::SetBinKey(unsigned char *Mem, int Keylen)
 bool cPlainKeyVia::Parse(const char *line)
 {
   unsigned char sid[3], skeynr, skey[VIA2_KEYLEN];
-  const char *sline=line;
   int len;
   if(GetChar(line,&type,1) && (len=GetHex(line,sid,3,false))) {
      type=toupper(type); id=Bin2Int(sid,len);
@@ -105,7 +104,6 @@ bool cPlainKeyVia::Parse(const char *line)
        return true;
        }
     }
-  FormatError("viaccess",sline);
   return false;
 }