diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index 728dc02..1374174 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -1680,3 +1680,8 @@ void cCA::SetCIRelevantPidsRouting(int RPR, int slot) } } #endif + +void cCA::SetCIOperator(int ciop, int slot) +{ + op[slot] = ciop; +} diff --git a/include/ca_ci.h b/include/ca_ci.h index be04e3a..b162a30 100644 --- a/include/ca_ci.h +++ b/include/ca_ci.h @@ -346,6 +346,9 @@ class cCA /// relevant pids routing void SetCIRelevantPidsRouting(int RPR, int slot = 0); #endif + /// ci operator mode + int op[4]; + void SetCIOperator(int ciop, int slot = 0); /// Start the CA module /// sh4 unused diff --git a/libdvbci/dvbci_resmgr.cpp b/libdvbci/dvbci_resmgr.cpp index 26f92e5..8a9ed15 100644 --- a/libdvbci/dvbci_resmgr.cpp +++ b/libdvbci/dvbci_resmgr.cpp @@ -74,33 +74,85 @@ int eDVBCIResourceManagerSession::doAction() const unsigned char tag[3] = {0x9F, 0x80, 0x11}; if (cCA::GetInstance()->CheckCerts()) { - const unsigned char data[][4] = + if (cCA::GetInstance()->op[slot->slot]) { - {0x00, 0x01, 0x00, 0x41}, // resource - {0x00, 0x02, 0x00, 0x41}, // application V1 - {0x00, 0x02, 0x00, 0x43}, // application V3 - {0x00, 0x03, 0x00, 0x41}, // conditional access - {0x00, 0x20, 0x00, 0x41}, // host control (dummy) - {0x00, 0x40, 0x00, 0x41}, // mmi - {0x00, 0x24, 0x00, 0x41}, // date-time - {0x00, 0x8c, 0x10, 0x01}, // content control - {0x00, 0x8e, 0x10, 0x01} // cam upgrade (dummy) -// {0x00, 0x10, 0x00, 0x41} // auth. - }; - sendAPDU(tag, data, sizeof(data)); + const unsigned char data[][4] = + { + {0x00, 0x01, 0x00, 0x41}, // res mgr 1 +// {0x00, 0x01, 0x00, 0x42}, // res mgr 2 + {0x00, 0x02, 0x00, 0x41}, // app mgr 1 + {0x00, 0x02, 0x00, 0x42}, // app mgr 2 + {0x00, 0x02, 0x00, 0x43}, // app mgr 3 + {0x00, 0x02, 0x00, 0x45}, // app mgr 5 + {0x00, 0x03, 0x00, 0x41}, // ca mgr + {0x00, 0x20, 0x00, 0x41}, // host ctrl 1 + {0x00, 0x20, 0x00, 0x42}, // host ctrl 2 + {0x00, 0x20, 0x00, 0x43}, // host ctrl 3 + {0x00, 0x24, 0x00, 0x41}, // datetime + {0x00, 0x40, 0x00, 0x41}, // mmi +// {0x00, 0x10, 0x00, 0x41}, // auth. + {0x00, 0x41, 0x00, 0x41}, // app mmi 1 + {0x00, 0x41, 0x00, 0x42}, // app mmi 2 + {0x00, 0x8c, 0x10, 0x01}, // content ctrl 1 + {0x00, 0x8c, 0x10, 0x02}, // content ctrl 2 + {0x00, 0x8c, 0x10, 0x04}, // content ctrl 4 + {0x00, 0x8d, 0x10, 0x01}, // Host lang ctrl + {0x00, 0x8e, 0x10, 0x01}, // Cam upgrade + {0x00, 0x8f, 0x10, 0x01}, // operator profile 1 + {0x00, 0x8f, 0x10, 0x02} // operator profile 2 +// {0x00, 0x97, 0x10, 0x01}, +// {0x00, 0x60, 0x60, 0x03}, +// {0x00, 0x04, 0x10, 0x01} + }; +// printf("<<<<< CI Modul Slot %i - operator profile >>>>>\n", slot->slot); + sendAPDU(tag, data, sizeof(data)); + } + else + { + const unsigned char data[][4] = + { + {0x00, 0x01, 0x00, 0x41}, // res mgr 1 +// {0x00, 0x01, 0x00, 0x42}, // res mgr 2 + {0x00, 0x02, 0x00, 0x41}, // app mgr 1 + {0x00, 0x02, 0x00, 0x42}, // app mgr 2 + {0x00, 0x02, 0x00, 0x43}, // app mgr 3 + {0x00, 0x02, 0x00, 0x45}, // app mgr 5 + {0x00, 0x03, 0x00, 0x41}, // ca mgr + {0x00, 0x20, 0x00, 0x41}, // host ctrl 1 + {0x00, 0x20, 0x00, 0x42}, // host ctrl 2 + {0x00, 0x20, 0x00, 0x43}, // host ctrl 3 + {0x00, 0x24, 0x00, 0x41}, // datetime + {0x00, 0x40, 0x00, 0x41}, // mmi +// {0x00, 0x10, 0x00, 0x41}, // auth. + {0x00, 0x41, 0x00, 0x41}, // app mmi 1 + {0x00, 0x41, 0x00, 0x42}, // app mmi 2 + {0x00, 0x8c, 0x10, 0x01}, // content ctrl 1 + {0x00, 0x8c, 0x10, 0x02}, // content ctrl 2 + {0x00, 0x8c, 0x10, 0x04}, // content ctrl 4 + {0x00, 0x8d, 0x10, 0x01}, // Host lang ctrl + {0x00, 0x8e, 0x10, 0x01} // Cam upgrade +// {0x00, 0x8f, 0x10, 0x01}, // operator profile 1 +// {0x00, 0x8f, 0x10, 0x02}, // operator profile 2 +// {0x00, 0x97, 0x10, 0x01}, +// {0x00, 0x60, 0x60, 0x03}, +// {0x00, 0x04, 0x10, 0x01} + }; +// printf("<<<<< CI Modul Slot %i - NO operator profile >>>>>\n", slot->slot); + sendAPDU(tag, data, sizeof(data)); + } } else { const unsigned char data[][4] = { - {0x00, 0x01, 0x00, 0x41}, // resource - {0x00, 0x02, 0x00, 0x41}, // application V1 - {0x00, 0x02, 0x00, 0x43}, // application V3 - {0x00, 0x03, 0x00, 0x41}, // conditional access -// {0x00, 0x20, 0x00, 0x41}, // host control - {0x00, 0x40, 0x00, 0x41}, // mmi - {0x00, 0x24, 0x00, 0x41} // date-time -// {0x00, 0x10, 0x00, 0x41} // auth. + {0x00, 0x01, 0x00, 0x41}, // res mgr 1 + {0x00, 0x02, 0x00, 0x41}, // app mgr 1 + {0x00, 0x02, 0x00, 0x43}, // app mgr 3 + {0x00, 0x03, 0x00, 0x41}, // ca mgr +// {0x00, 0x20, 0x00, 0x41}, // host ctrl 1 + {0x00, 0x24, 0x00, 0x41}, // datetime + {0x00, 0x40, 0x00, 0x41} // mmi +// {0x00, 0x10, 0x00, 0x41} // auth. }; sendAPDU(tag, data, sizeof(data)); } diff --git a/libdvbci/dvbci_session.cpp b/libdvbci/dvbci_session.cpp index 3efb867..a7f046d 100644 --- a/libdvbci/dvbci_session.cpp +++ b/libdvbci/dvbci_session.cpp @@ -191,7 +191,9 @@ eDVBCISession *eDVBCISession::createSession(eDVBCISlot *slot, const unsigned cha printf("[CI SESS] RESOURCE MANAGER\n"); break; case 0x00020041: + case 0x00020042: case 0x00020043: + case 0x00020045: sessions[session_nb - 1] = new eDVBCIApplicationManagerSession(slot); printf("[CI SESS] APPLICATION MANAGER\n"); break;