SASC-NG
DVBSoftCAM

cSmartCardDataIrdeto Class Reference

Inheritance diagram for cSmartCardDataIrdeto:

List of all members.

Public Member Functions

 cSmartCardDataIrdeto (void)
 cSmartCardDataIrdeto (int Acs, int Caid)
virtual bool Parse (const char *line)
virtual bool Matches (cSmartCardData *param)

Public Attributes

int acs
int caid
cBN mod
cBN exp
bool plain

Detailed Description

Definition at line 264 of file sc-irdeto.c.


Constructor & Destructor Documentation

cSmartCardDataIrdeto::cSmartCardDataIrdeto ( void  )

Definition at line 276 of file sc-irdeto.c.

References plain.

:cSmartCardData(SC_ID)
{
  plain=false;
}
cSmartCardDataIrdeto::cSmartCardDataIrdeto ( int  Acs,
int  Caid 
)

Definition at line 282 of file sc-irdeto.c.

References acs, caid, and plain.

:cSmartCardData(SC_ID)
{
  acs=Acs; caid=Caid;
  plain=false;
}

Member Function Documentation

bool cSmartCardDataIrdeto::Matches ( cSmartCardData *  param) [virtual]

Implements cSmartCardData.

Definition at line 289 of file sc-irdeto.c.

References acs, and caid.

{
  cSmartCardDataIrdeto *cd=(cSmartCardDataIrdeto *)param;
  return cd->acs==acs && (cd->caid==caid || caid==-1);
}
bool cSmartCardDataIrdeto::Parse ( const char *  line) [virtual]

Implements cSmartCardData.

Definition at line 295 of file sc-irdeto.c.

References acs, BN_complement(), caid, exp, GetHex(), L_CORE_LOAD, mod, plain, PRINTF, and skipspace().

{
  unsigned char buff[512];
  acs=caid=-1; // default
  line=skipspace(line);
  if(*line=='[') { // parse acs & caid
    line++;
    if(GetHex(line,buff,2)!=2) {
      PRINTF(L_CORE_LOAD,"smartcarddatairdeto: format error: acs");
      return false;
      }
    acs=buff[0]*256+buff[1];

    line=skipspace(line);
    if(*line=='/') {
      line++;
      if(GetHex(line,buff,2)!=2) {
        PRINTF(L_CORE_LOAD,"smartcarddatairdeto: format error: caid");
        return false;
        }
      caid=buff[0]*256+buff[1];
      line=skipspace(line);
      }

    if(!*line==']') {
      PRINTF(L_CORE_LOAD,"smartcarddatairdeto: format error: closing ]");
      return false;
      }
    line++;
    }

  line=skipspace(line);
  if(!strncasecmp(line,"plain",5)) {
    plain=true;
    return true;
    }
  int l;
  if((l=GetHex(line,buff,sizeof(buff),false))<=0) {
    PRINTF(L_CORE_LOAD,"smartcarddatairdeto: format error: mod");
    return false;
    }
  BN_complement(buff,l,mod);
  if((l=GetHex(line,buff,sizeof(buff),false))<=0) {
    PRINTF(L_CORE_LOAD,"smartcarddatairdeto: format error: exp");
    return false;
    }
  BN_bin2bn(buff,l,exp);
  return true;
}

Member Data Documentation

Definition at line 266 of file sc-irdeto.c.

Referenced by cSmartCardDataIrdeto(), Matches(), and Parse().

Definition at line 266 of file sc-irdeto.c.

Referenced by cSmartCardDataIrdeto(), Matches(), and Parse().

Definition at line 267 of file sc-irdeto.c.

Referenced by cSmartCardIrdeto::Init(), and Parse().

Definition at line 267 of file sc-irdeto.c.

Referenced by cSmartCardIrdeto::Init(), and Parse().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines