|
SASC
DVBSoftCAM
|
#include <smartcard.h>
Inheritance diagram for cSmartCard:Public Member Functions | |
| cSmartCard (const struct CardConfig *Cfg, const struct StatusMsg *Msg) | |
| virtual | ~cSmartCard () |
| virtual bool | Init (void)=0 |
| virtual bool | Decode (const cEcmInfo *ecm, const unsigned char *data, unsigned char *cw)=0 |
| virtual bool | Update (int pid, int caid, const unsigned char *data) |
| virtual bool | CanHandle (unsigned short CaId) |
| bool | Setup (cSmartCardSlot *Slot, int sermode, const struct Atr *Atr, unsigned char *Sb) |
| bool | CardUp (void) |
| bool | GetCardIdStr (char *str, int len) |
| bool | GetCardInfoStr (char *str, int len) |
| cSmartCard (const struct CardConfig *Cfg, const struct StatusMsg *Msg) | |
| virtual | ~cSmartCard () |
| virtual bool | Init (void)=0 |
| virtual bool | Decode (const cEcmInfo *ecm, const unsigned char *data, unsigned char *cw)=0 |
| virtual bool | Update (int pid, int caid, const unsigned char *data) |
| virtual bool | CanHandle (unsigned short CaId) |
| bool | Setup (cSmartCardSlot *Slot, int sermode, const struct Atr *Atr, unsigned char *Sb) |
| bool | CardUp (void) |
| bool | GetCardIdStr (char *str, int len) |
| bool | GetCardInfoStr (char *str, int len) |
Protected Member Functions | |
| int | SerRead (unsigned char *data, int len, int to=0) |
| int | SerWrite (const unsigned char *data, int len) |
| bool | IsoRead (const unsigned char *cmd, unsigned char *data) |
| bool | IsoWrite (const unsigned char *cmd, const unsigned char *data) |
| bool | Status (void) |
| void | NewCardConfig (const struct CardConfig *Cfg) |
| int | CheckSctLen (const unsigned char *data, int off) |
| void | CaidsChanged (void) |
| int | SerRead (unsigned char *data, int len, int to=0) |
| int | SerWrite (const unsigned char *data, int len) |
| bool | IsoRead (const unsigned char *cmd, unsigned char *data) |
| bool | IsoWrite (const unsigned char *cmd, const unsigned char *data) |
| bool | Status (void) |
| void | NewCardConfig (const struct CardConfig *Cfg) |
| int | CheckSctLen (const unsigned char *data, int off) |
| void | CaidsChanged (void) |
Protected Attributes | |
| struct Atr * | atr |
| unsigned char * | sb |
| char | idStr [IDSTR_LEN] |
| cInfoStr | infoStr |
Definition at line 110 of file smartcard.h.
| cSmartCard::cSmartCard | ( | const struct CardConfig * | Cfg, |
| const struct StatusMsg * | Msg | ||
| ) |
Definition at line 1917 of file smartcard.c.
References idStr, NewCardConfig(), and sb.
{
msg=Msg;
slot=0; sb=0; atr=0; idStr[0]=0; cardUp=false;
NewCardConfig(Cfg);
}
| virtual cSmartCard::~cSmartCard | ( | ) | [inline, virtual] |
Definition at line 133 of file smartcard.h.
{};
| cSmartCard::cSmartCard | ( | const struct CardConfig * | Cfg, |
| const struct StatusMsg * | Msg | ||
| ) |
| virtual cSmartCard::~cSmartCard | ( | ) | [inline, virtual] |
Definition at line 133 of file smartcard.h.
{};
| void cSmartCard::CaidsChanged | ( | void | ) | [protected] |
Definition at line 2002 of file smartcard.c.
Referenced by cSmartCardVideoGuard2::Init(), cSmartCardIrdeto::Init(), cSmartCardCryptoworks::Init(), and cSmartCardConax::Init().
{
cGlobal::CaidsChanged();
}
| void cSmartCard::CaidsChanged | ( | void | ) | [protected] |
| virtual bool cSmartCard::CanHandle | ( | unsigned short | CaId | ) | [inline, virtual] |
Reimplemented in cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardVideoGuard2, cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, and cSmartCardVideoGuard2.
Definition at line 137 of file smartcard.h.
Referenced by cSystemLinkScVideoGuard2::CanHandle(), cSystemLinkScNagra::CanHandle(), cSystemLinkScIrdeto::CanHandle(), cSystemLinkScCryptoworks::CanHandle(), and cSystemLinkScConax::CanHandle().
{ return true; }
| virtual bool cSmartCard::CanHandle | ( | unsigned short | CaId | ) | [inline, virtual] |
Reimplemented in cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardVideoGuard2, cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, and cSmartCardVideoGuard2.
Definition at line 137 of file smartcard.h.
{ return true; }
| bool cSmartCard::CardUp | ( | void | ) | [inline] |
Definition at line 140 of file smartcard.h.
Referenced by cSmartCardSlot::LockCard().
{ return cardUp; }
| bool cSmartCard::CardUp | ( | void | ) | [inline] |
Definition at line 140 of file smartcard.h.
{ return cardUp; }
| int cSmartCard::CheckSctLen | ( | const unsigned char * | data, |
| int | off | ||
| ) | [protected] |
Definition at line 1992 of file smartcard.c.
References L_CORE_SC, MAX_LEN, PRINTF, and SCT_LEN.
Referenced by cSmartCardCryptoworks::Decode(), cSmartCardConax::Decode(), cSmartCardCryptoworks::Update(), and cSmartCardConax::Update().
| int cSmartCard::CheckSctLen | ( | const unsigned char * | data, |
| int | off | ||
| ) | [protected] |
| virtual bool cSmartCard::Decode | ( | const cEcmInfo * | ecm, |
| const unsigned char * | data, | ||
| unsigned char * | cw | ||
| ) | [pure virtual] |
Implemented in cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, cSmartCardVideoGuard2, cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, and cSmartCardVideoGuard2.
Referenced by cSystemScCore::ProcessECM().
| virtual bool cSmartCard::Decode | ( | const cEcmInfo * | ecm, |
| const unsigned char * | data, | ||
| unsigned char * | cw | ||
| ) | [pure virtual] |
| bool cSmartCard::GetCardIdStr | ( | char * | str, |
| int | len | ||
| ) |
| bool cSmartCard::GetCardIdStr | ( | char * | str, |
| int | len | ||
| ) |
Definition at line 1930 of file smartcard.c.
References idStr, and strn0cpy().
Referenced by cSmartCardSlot::GetCardIdStr().
| bool cSmartCard::GetCardInfoStr | ( | char * | str, |
| int | len | ||
| ) |
Definition at line 1936 of file smartcard.c.
References cInfoStr::Get(), and infoStr.
Referenced by cSmartCardSlot::GetCardInfoStr().
| bool cSmartCard::GetCardInfoStr | ( | char * | str, |
| int | len | ||
| ) |
| virtual bool cSmartCard::Init | ( | void | ) | [pure virtual] |
Implemented in cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, cSmartCardVideoGuard2, cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, and cSmartCardVideoGuard2.
Referenced by Setup().
| virtual bool cSmartCard::Init | ( | void | ) | [pure virtual] |
| bool cSmartCard::IsoRead | ( | const unsigned char * | cmd, |
| unsigned char * | data | ||
| ) | [protected] |
| bool cSmartCard::IsoRead | ( | const unsigned char * | cmd, |
| unsigned char * | data | ||
| ) | [protected] |
Definition at line 1964 of file smartcard.c.
References cSmartCardSlot::IsoRead(), L_CORE_SC, and PRINTF.
Referenced by cSmartCardViaccess::Decode(), cSmartCardSeca::Decode(), cSmartCardConax::Decode(), cSmartCardVideoGuard2::DoCmd(), cSmartCardVideoGuard2::Init(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardCryptoworks::Init(), cSmartCardConax::Init(), cSmartCardVideoGuard2::ReadCmdLen(), and cSmartCardVideoGuard2::ReadTiers().
| bool cSmartCard::IsoWrite | ( | const unsigned char * | cmd, |
| const unsigned char * | data | ||
| ) | [protected] |
Definition at line 1971 of file smartcard.c.
References cSmartCardSlot::IsoWrite(), L_CORE_SC, and PRINTF.
Referenced by cSmartCardViaccess::Decode(), cSmartCardSeca::Decode(), cSmartCardCryptoworks::Decode(), cSmartCardConax::Decode(), cSmartCardVideoGuard2::DoCmd(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardCryptoworks::Init(), cSmartCardConax::Init(), cSmartCardViaccess::Update(), cSmartCardSeca::Update(), cSmartCardCryptoworks::Update(), and cSmartCardConax::Update().
| bool cSmartCard::IsoWrite | ( | const unsigned char * | cmd, |
| const unsigned char * | data | ||
| ) | [protected] |
| void cSmartCard::NewCardConfig | ( | const struct CardConfig * | Cfg | ) | [protected] |
| void cSmartCard::NewCardConfig | ( | const struct CardConfig * | Cfg | ) | [protected] |
Definition at line 1924 of file smartcard.c.
References cSmartCardSlot::SetCardConfig().
Referenced by cSmartCard(), and cSmartCardVideoGuard2::Init().
{
cfg=Cfg;
if(slot) slot->SetCardConfig(cfg);
}
| int cSmartCard::SerRead | ( | unsigned char * | data, |
| int | len, | ||
| int | to = 0 |
||
| ) | [protected] |
| int cSmartCard::SerRead | ( | unsigned char * | data, |
| int | len, | ||
| int | to = 0 |
||
| ) | [protected] |
| int cSmartCard::SerWrite | ( | const unsigned char * | data, |
| int | len | ||
| ) | [protected] |
| int cSmartCard::SerWrite | ( | const unsigned char * | data, |
| int | len | ||
| ) | [protected] |
| bool cSmartCard::Setup | ( | cSmartCardSlot * | Slot, |
| int | sermode, | ||
| const struct Atr * | Atr, | ||
| unsigned char * | Sb | ||
| ) |
| bool cSmartCard::Setup | ( | cSmartCardSlot * | Slot, |
| int | sermode, | ||
| const struct Atr * | Atr, | ||
| unsigned char * | Sb | ||
| ) |
Definition at line 1941 of file smartcard.c.
References Init(), sb, cSmartCardSlot::SetCardConfig(), and cSmartCardSlot::SlotNum().
Referenced by cSmartCardSlot::Action().
| bool cSmartCard::Status | ( | void | ) | [protected] |
Definition at line 1978 of file smartcard.c.
References L_CORE_SC, StatusMsg::message, PRINTF, StatusMsg::retval, sb, and StatusMsg::sb.
Referenced by cSmartCardVideoGuard2::Decode(), cSmartCardViaccess::Decode(), cSmartCardSeca::Decode(), cSmartCardNagra::Decode(), cSmartCardIrdeto::Decode(), cSmartCardCryptoworks::Decode(), cSmartCardConax::Decode(), cSmartCardVideoGuard2::DoCmd(), cSmartCardVideoGuard2::Init(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardNagra::Init(), cSmartCardIrdeto::Init(), cSmartCardCryptoworks::Init(), cSmartCardConax::Init(), cSmartCardVideoGuard2::ReadCmdLen(), cSmartCardVideoGuard2::ReadTiers(), cSmartCardVideoGuard2::Update(), cSmartCardViaccess::Update(), cSmartCardSeca::Update(), cSmartCardNagra::Update(), cSmartCardIrdeto::Update(), cSmartCardCryptoworks::Update(), and cSmartCardConax::Update().
{
const struct StatusMsg *m=msg;
while(m->sb[0]!=0xFF) {
if(sb[0]==m->sb[0] && (m->sb[1]==0xFF || sb[1]==m->sb[1])) {
if(!m->retval) PRINTF(L_CORE_SC,"%d: %s (status: %02x %02x)",slotnum,m->message,sb[0],sb[1]);
return m->retval;
}
m++;
}
PRINTF(L_CORE_SC,"%d: unknown (status: %02x %02x)",slotnum,sb[0],sb[1]);
return false;
}
| bool cSmartCard::Status | ( | void | ) | [protected] |
| virtual bool cSmartCard::Update | ( | int | pid, |
| int | caid, | ||
| const unsigned char * | data | ||
| ) | [inline, virtual] |
Reimplemented in cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, cSmartCardVideoGuard2, cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, and cSmartCardVideoGuard2.
Definition at line 136 of file smartcard.h.
{ return false; }
| virtual bool cSmartCard::Update | ( | int | pid, |
| int | caid, | ||
| const unsigned char * | data | ||
| ) | [inline, virtual] |
Reimplemented in cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, cSmartCardVideoGuard2, cSmartCardConax, cSmartCardCryptoworks, cSmartCardIrdeto, cSmartCardNagra, cSmartCardSeca, cSmartCardViaccess, and cSmartCardVideoGuard2.
Definition at line 136 of file smartcard.h.
Referenced by cSystemScCore::ProcessEMM().
{ return false; }
struct Atr * cSmartCard::atr [protected] |
Definition at line 118 of file smartcard.h.
Referenced by cSmartCardVideoGuard2::Init(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardNagra::Init(), cSmartCardIrdeto::Init(), cSmartCardCryptoworks::Init(), and cSmartCardConax::Init().
char cSmartCard::idStr [protected] |
Definition at line 120 of file smartcard.h.
Referenced by cSmartCard(), GetCardIdStr(), cSmartCardVideoGuard2::Init(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardIrdeto::Init(), cSmartCardCryptoworks::Init(), and cSmartCardConax::Init().
cInfoStr cSmartCard::infoStr [protected] |
Definition at line 121 of file smartcard.h.
Referenced by GetCardInfoStr(), cSmartCardVideoGuard2::Init(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardNagra::Init(), cSmartCardIrdeto::Init(), cSmartCardCryptoworks::Init(), cSmartCardConax::Init(), and cSmartCardVideoGuard2::ReadTiers().
unsigned char * cSmartCard::sb [protected] |
Definition at line 119 of file smartcard.h.
Referenced by cSmartCard(), cSmartCardSeca::Decode(), cSmartCardVideoGuard2::DoCmd(), Setup(), and Status().