cSimpleList<cSystem> systems;
//
cLogChain(int CardNum, bool soft, int src, int tr);
- void Process(int pid, unsigned char *data);
+ void Process(int pid, const unsigned char *data);
bool Parse(const unsigned char *cat);
};
active=delayed=false;
}
-void cLogChain::Process(int pid, unsigned char *data)
+void cLogChain::Process(int pid, const unsigned char *data)
{
if(active) {
for(cSystem *sys=systems.First(); sys; sys=systems.Next(sys))
return res;
}
-void cSystemScCore::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemScCore::ProcessEMM(int pid, int caid, const unsigned char *buffer)
{
cSmartCard *card=smartcards.LockCard(scId);
if(card) {
public:
cSystemScCore(const char *Name, int Pri, int ScId, const char *ScName);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *data);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *data);
};
#endif //___SYSTEM_COMMON_H
virtual int CheckECM(const cEcmInfo *ecm, const unsigned char *data, bool sync);
virtual void CheckECMResult(const cEcmInfo *ecm, const unsigned char *data, bool result);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *buffer)=0;
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer) {};
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer) {};
virtual void ParseCADescriptor(cSimpleList<cEcmInfo> *ecms, unsigned short sysId, int source, const unsigned char *data, int len);
virtual void ParseCAT(cPids *pids, const unsigned char *buffer, int source, int transponder);
unsigned char *CW(void) { return cw; }
public:
cSystemCardClient(void);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer);
};
cSystemCardClient::cSystemCardClient(void)
return false;
}
-void cSystemCardClient::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemCardClient::ProcessEMM(int pid, int caid, const unsigned char *buffer)
{
cCardClient *cc=0;
while((cc=staticCcl.FindBySysId(caid,cc)))
public:
cSystemIrd(void);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *source);
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer);
};
cSystemIrd::cSystemIrd(void)
return false;
}
-void cSystemIrd::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemIrd::ProcessEMM(int pid, int caid, const unsigned char *data)
{
int i, numKeys=0, date=0;
unsigned char adr[10], id[4], *pk[4], prov, *mk=0, prvId[3]={0,0,0};
- int n=SCT_LEN(buffer);
- unsigned char savebuf[4096];
- if(n>(int)sizeof(savebuf)) {
- PRINTF(L_SYS_EMM,"%d: paket size %d to big for savebuffer in IrdetoLog",CardNum(),n);
- return;
- }
+ int n=SCT_LEN(data);
+ unsigned char *buffer=AUTOMEM(n);
+ memcpy(buffer,data,n);
int index=cParseIrdeto::AddrLen(buffer);
memset(adr,0,sizeof(adr));
// lastKey: save cpu time if we get bursts of the same key
if((numKeys>0 && (id[0]!=lastKey || numKeys>1)) || mk) {
- memcpy(savebuf,buffer,n); // save the buffer
cIrdCardInfo *ci=Icards.First();
unsigned char *chkkey=AUTOMEM(max(sizeof(ci->PMK),sizeof(ci->HMK)));
while(ci) {
}
LBEND();
- memcpy(buffer,savebuf,n); // restore the buffer
+ memcpy(buffer,data,n); // restore the buffer
}
ci=Icards.Next(ci);
}
public:
cSystemIrd2(void);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *data);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *data);
};
cSystemIrd2::cSystemIrd2(void)
return false;
}
-void cSystemIrd2::ProcessEMM(int pid, int caid, unsigned char *data)
+void cSystemIrd2::ProcessEMM(int pid, int caid, const unsigned char *data)
{
int prov=0; //XXX how to get provider here??
cSystemNagra(void);
virtual ~cSystemNagra();
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer);
};
cSystemNagra::cSystemNagra(void)
return true;
}
-void cSystemNagra::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemNagra::ProcessEMM(int pid, int caid, const unsigned char *buffer)
{
const int id=buffer[10]*256+buffer[11];
static const unsigned char tester[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x4B };
cSystemNagra2(void);
~cSystemNagra2();
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer);
};
cSystemNagra2::cSystemNagra2(void)
return true;
}
-void cSystemNagra2::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemNagra2::ProcessEMM(int pid, int caid, const unsigned char *buffer)
{
int cmdLen=buffer[9]-5;
int id=buffer[10]*256+buffer[11];
cSystemSeca(void);
virtual ~cSystemSeca();
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer);
};
cSystemSeca::cSystemSeca(void)
for(int i=7; i>=0; i--) data[i] = P[i] ? pdata[P[i]] : 0;
}
-void cSystemSeca::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemSeca::ProcessEMM(int pid, int caid, const unsigned char *buffer)
{
if(buffer[0]!=0x84) return; // we only support shared updates
cSystemShl(void);
virtual ~cSystemShl();
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *source);
- virtual void ProcessEMM(int pid, int caid, unsigned char *buffer);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *buffer);
};
cSystemShl::cSystemShl(void)
}
}
-void cSystemShl::ProcessEMM(int pid, int caid, unsigned char *buffer)
+void cSystemShl::ProcessEMM(int pid, int caid, const unsigned char *buffer)
{
int n=SCT_LEN(buffer)-3;
buffer+=3;
public:
cSystemViaccess(void);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
- virtual void ProcessEMM(int pid, int caid, unsigned char *data);
+ virtual void ProcessEMM(int pid, int caid, const unsigned char *data);
virtual void ParseCADescriptor(cSimpleList<cEcmInfo> *ecms, unsigned short sysId, int source, const unsigned char *data, int len);
};
return false;
}
-void cSystemViaccess::ProcessEMM(int pid, int caid, unsigned char *data)
+void cSystemViaccess::ProcessEMM(int pid, int caid, const unsigned char *data)
{
for(cViaccessCardInfo *mkey=Vcards.First(); mkey; mkey=Vcards.Next(mkey)) {
int updtype;