|
SASC
DVBSoftCAM
|
Inheritance diagram for cSystemConax:Public Member Functions | |
| cSystemConax (void) | |
| virtual bool | ProcessECM (const cEcmInfo *ecm, unsigned char *source) |
| cSystemConax (void) | |
| virtual bool | ProcessECM (const cEcmInfo *ecm, unsigned char *source) |
| cSystemConax::cSystemConax | ( | void | ) |
Definition at line 62 of file conax.c.
:cSystem(SYSTEM_NAME,SYSTEM_PRI) {}
| cSystemConax::cSystemConax | ( | void | ) |
| bool cSystemConax::ProcessECM | ( | const cEcmInfo * | ecm, |
| unsigned char * | source | ||
| ) | [virtual] |
Implements cSystem.
Definition at line 88 of file conax.c.
References cSystem::doLog, exp, cPlainKeys::FindKey(), cPlainKey::Get(), hash, keys, L_SYS_CRYPTO, L_SYS_ECM, L_SYS_KEY, mod, cKeySnoop::OK(), PRINTF, and cRSA::RSA().
{
int length=source[4]-2;
const int keyid=source[6];
const int nano=source[5];
source+=7;
cKeySnoop ks(this,'C',keyid,'M');
cPlainKey *pk;
cBN mod, exp;
if(!(pk=keys.FindKey('C',keyid,'E',-1))) {
if(doLog) PRINTF(L_SYS_KEY,"missing %02X E key",keyid);
return false;
}
pk->Get(exp);
if(!(pk=keys.FindKey('C',keyid,'M',-1))) {
if(doLog) PRINTF(L_SYS_KEY,"missing %02X M key",keyid);
return false;
}
pk->Get(mod);
for(int i=length ; i>0 ;) {
int index=i-64;
if(index<0) index=0;
if(rsa.RSA(source+index,source+index,64,exp,mod,false)<=0) {
if(doLog) PRINTF(L_SYS_CRYPTO,"RSA failed");
return false;
}
if(nano==0x63) {
// nano 0x63 block only decodes to 63 bytes
memmove(source+index,source+index+1,length-(index+1));
length-=1;
}
i-=(i%60 && index) ? i%60 : 64;
}
static const unsigned char hash[] = { 0x05,0x00,0x05 };
if(memcmp(hash,source+2,3) || memcmp(source+5,source+length-5,3)) {
if(doLog) PRINTF(L_SYS_ECM,"signature check failed");
return false;
}
ParseECM(source+10,length-10);
ks.OK(pk);
return true;
}
| virtual bool cSystemConax::ProcessECM | ( | const cEcmInfo * | ecm, |
| unsigned char * | source | ||
| ) | [virtual] |
Implements cSystem.