|
SASC
DVBSoftCAM
|
Inheritance diagram for cSmartCardDataViaccess:Public Member Functions | |
| cSmartCardDataViaccess (void) | |
| cSmartCardDataViaccess (eDataType Type, unsigned char *Id) | |
| virtual bool | Parse (const char *line) |
| virtual bool | Matches (cSmartCardData *param) |
| cSmartCardDataViaccess (void) | |
| cSmartCardDataViaccess (eDataType Type, unsigned char *Id) | |
| virtual bool | Parse (const char *line) |
| virtual bool | Matches (cSmartCardData *param) |
Public Attributes | |
| eDataType | type |
| unsigned char | id [5] |
| unsigned char | pin [8] |
| unsigned char | aes [16] |
Definition at line 116 of file sc-viaccess.c.
| cSmartCardDataViaccess::cSmartCardDataViaccess | ( | void | ) |
Definition at line 129 of file sc-viaccess.c.
:cSmartCardData(SC_ID) { memset(id,0,sizeof(id)); }
| cSmartCardDataViaccess::cSmartCardDataViaccess | ( | eDataType | Type, |
| unsigned char * | Id | ||
| ) |
Definition at line 135 of file sc-viaccess.c.
References type.
:cSmartCardData(SC_ID) { type=Type; memset(id,0,sizeof(id)); memcpy(id,Id,IdLen()); }
| cSmartCardDataViaccess::cSmartCardDataViaccess | ( | void | ) |
| cSmartCardDataViaccess::cSmartCardDataViaccess | ( | eDataType | Type, |
| unsigned char * | Id | ||
| ) |
| bool cSmartCardDataViaccess::Matches | ( | cSmartCardData * | param | ) | [virtual] |
Implements cSmartCardData.
Definition at line 143 of file sc-viaccess.c.
{
cSmartCardDataViaccess *cd=(cSmartCardDataViaccess *)param;
return cd->type==type && !memcmp(cd->id,id,IdLen());
}
| virtual bool cSmartCardDataViaccess::Matches | ( | cSmartCardData * | param | ) | [virtual] |
Implements cSmartCardData.
| virtual bool cSmartCardDataViaccess::Parse | ( | const char * | line | ) | [virtual] |
Implements cSmartCardData.
| bool cSmartCardDataViaccess::Parse | ( | const char * | line | ) | [virtual] |
Implements cSmartCardData.
Definition at line 149 of file sc-viaccess.c.
References aes, dtAES, dtPIN, GetHex(), i, L_CORE_LOAD, LDUMP, pin, PRINTF, skipspace(), and type.
{
line=skipspace(line);
if(!strncasecmp(line,"PIN",3)) { type=dtPIN; line+=3; }
else if(!strncasecmp(line,"AES",3)) { type=dtAES; line+=3; }
else {
PRINTF(L_CORE_LOAD,"smartcarddataviaccess: format error: datatype");
return false;
}
line=skipspace(line);
if(GetHex(line,id,IdLen())!=IdLen()) {
PRINTF(L_CORE_LOAD,"smartcarddataviaccess: format error: serial");
return false;
}
line=skipspace(line);
if(type==dtPIN) {
memset(pin,0,sizeof(pin));
int i, shift=4;
for(i=0; i<16; i++) {
if(!isdigit(*line)) {
PRINTF(L_CORE_LOAD,"smartcarddataviaccess: format error: pin");
return false;
}
pin[i]|=(*line++ - '0')<<shift;
shift^=4;
}
i=(i+1)/2; // num bytes
memmove(&pin[8-i],pin,i);
//XXX
LDUMP(L_CORE_LOAD,pin,sizeof(pin),"smartcarddataviaccess: pin ");
}
else {
if(GetHex(line,aes,16)!=16) {
PRINTF(L_CORE_LOAD,"smartcarddataviaccess: format error: aes");
return false;
}
}
return true;
}
| unsigned char cSmartCardDataViaccess::aes |
Definition at line 121 of file sc-viaccess.c.
Referenced by cSmartCardViaccess::Init(), and Parse().
| unsigned char cSmartCardDataViaccess::id |
Definition at line 121 of file sc-viaccess.c.
Referenced by Matches().
| unsigned char cSmartCardDataViaccess::pin |
Definition at line 121 of file sc-viaccess.c.
Referenced by cSmartCardViaccess::Init(), and Parse().
Definition at line 120 of file sc-viaccess.c.
Referenced by cSmartCardDataViaccess(), Matches(), and Parse().