ci-alc automatically Multi-Decrypt

Origin commit data
------------------
Branch: master
Commit: 7f178d38f9
Author: max_10 <max_10@gmx.de>
Date: 2016-08-05 (Fri, 05 Aug 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2016-08-05 23:21:48 +02:00
parent fdc3d592a6
commit 7d94090b42
7 changed files with 209 additions and 101 deletions

View File

@@ -43,7 +43,7 @@ int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag, cons
printf(" application_type: %d\n", ((unsigned char*)data)[0]);
printf(" application_manufacturer: %02x %02x\n", ((unsigned char*)data)[2], ((unsigned char*)data)[1]);
printf(" manufacturer_code: %02x %02x\n", ((unsigned char*)data)[4], ((unsigned char*)data)[3]);
printf(" menu string: \n");
printf(" menu string: ");
dl = ((unsigned char*)data)[5];
if ((dl + 6) > len)
{
@@ -58,7 +58,9 @@ int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag, cons
printf("\n");
strcpy(slot->name, str);
printf("%s set cam name %s on slot %d, %p\n", FILENAME, slot->name, slot->slot, slot);
if (!strcmp(slot->name, "AlphaCrypt"))
slot->multi = true;
printf("%s set cam name %s on slot(%d)\n", FILENAME, slot->name, slot->slot);
break;
}
default:
@@ -82,7 +84,7 @@ int eDVBCIApplicationManagerSession::doAction()
return 1;
}
case stateFinal:
printf("in final state.");
printf("%s -> in final state\n", FILENAME);
wantmenu = 0;
if (wantmenu)
{

View File

@@ -1147,7 +1147,11 @@ bool eDVBCIContentControlManagerSession::ci_ccmgr_cc_data_req(tSlot *tslot, cons
return true;
}
void eDVBCIContentControlManagerSession::ci_ccmgr_cc_sac_sync_req(tSlot *tslot, const uint8_t *data, unsigned int len)
void eDVBCIContentControlManagerSession::ci_ccmgr_cc_sac_sync_req(tSlot *tslot, const uint8_t *data, unsigned int
#if y_debug
len
#endif
)
{
const uint8_t sync_cnf_tag[3] = { 0x9f, 0x90, 0x10 };
uint8_t dest[64];
@@ -1337,7 +1341,11 @@ int eDVBCIContentControlManagerSession::doAction()
void eDVBCIContentControlManagerSession::resendKey(tSlot *tslot)
{
if (!tslot->SidBlackListed && (tslot->recordUse || tslot->liveUse))
/* Fix me ! no ci* cam with multi decrypt is known
* therefore for now it is OK to use element [0]
* in bool arrays */
if (!tslot->SidBlackListed && (tslot->recordUse[0] || tslot->liveUse[0]))
descrambler_set_key((int)tslot->source, tslot->lastParity, tslot->lastKey);
}

View File

@@ -135,11 +135,11 @@ int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, i
if ((d + 3) > max)
break;
printf("text tag: %02x %02x %02x\n", d[0], d[1], d[2]);
//printf("text tag: %02x %02x %02x\n", d[0], d[1], d[2]);
d += 3;
d += eDVBCISession::parseLengthField(d, textlen);
printf("%d bytes text", textlen);
printf("%d bytes text > ", textlen);
if ((d + textlen) > max)
break;
@@ -159,7 +159,8 @@ int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, i
{
strcpy(listInfo->choice_item[listInfo->choice_nb], str);
listInfo->choice_nb++;
printf("%d. %s\n", listInfo->choice_nb, listInfo->choice_item[listInfo->choice_nb - 1]);
printf("%d. ", listInfo->choice_nb);
//printf("%s\n", listInfo->choice_item[listInfo->choice_nb - 1]);
}
while (textlen--)
printf("%c", *d++);
@@ -234,6 +235,8 @@ int eDVBCIMMISession::doAction()
int eDVBCIMMISession::stopMMI()
{
printf("%s -> %s\n", FILENAME, __func__);
unsigned char tag[] = {0x9f, 0x88, 0x00};
unsigned char data[] = {0x00};
sendAPDU(tag, data, 1);
@@ -244,7 +247,7 @@ int eDVBCIMMISession::stopMMI()
int eDVBCIMMISession::answerText(int answer)
{
printf("eDVBCIMMISession::answerText(%d)\n", answer);
printf("%s -> %s(%d)\n", FILENAME, __func__, answer);
unsigned char tag[] = {0x9f, 0x88, 0x0B};
unsigned char data[] = {0x00};
@@ -256,7 +259,7 @@ int eDVBCIMMISession::answerText(int answer)
int eDVBCIMMISession::answerEnq(char * answer, int len)
{
printf("eDVBCIMMISession::answerEnq(%d bytes)\n", len);
printf("%s -> %s(%d bytes)\n", FILENAME, __func__, len);
unsigned char data[len + 1];
data[0] = 0x01; // answer ok
@@ -270,7 +273,7 @@ int eDVBCIMMISession::answerEnq(char * answer, int len)
int eDVBCIMMISession::cancelEnq()
{
printf("eDVBCIMMISession::cancelEnq()\n");
printf("%s -> %s\n", FILENAME, __func__);
unsigned char tag[] = {0x9f, 0x88, 0x08};
unsigned char data[] = {0x00}; // canceled

View File

@@ -7,22 +7,25 @@ static const char * FILENAME = "[dvbci_resmgr]";
int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
{
printf("SESSION(%d)RES %02x %02x %02x (len = %d): \n", session_nb, tag[0], tag[1], tag[2], len);
for (int i = 0; i < len; i++)
printf("%02x ", ((const unsigned char*)data)[i]);
printf("\n");
if (len)
{
for (int i = 0; i < len; i++)
printf("%02x ", ((const unsigned char*)data)[i]);
printf("\n");
}
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
{
switch (tag[2])
{
case 0x10: // profile enquiry
printf("cam fragt was ich kann.\n");
printf("%s -> cam asks what I'm able to\n", FILENAME);
state = stateProfileEnquiry;
return 1;
break;
case 0x11: // Tprofile
printf("mein cam kann: ");
printf("%s -> my cam can do: ", FILENAME);
if (!len)
printf("nichts\n");
printf("nothing");
else
for (int i = 0; i < len; i++)
printf("%02x ", ((const unsigned char*)data)[i]);

View File

@@ -107,7 +107,7 @@ void eDVBCISession::recvCreateSessionResponse(const unsigned char *data)
status = data[0];
state = stateStarted;
action = 1;
printf("create Session Response, status %x\n", status);
printf("%s -> %s status(%x)\n", FILENAME, __func__, status);
}
void eDVBCISession::recvCloseSessionRequest(const unsigned char *data)
@@ -115,11 +115,13 @@ void eDVBCISession::recvCloseSessionRequest(const unsigned char *data)
status = data[0];
state = stateInDeletion;
action = 1;
printf("close Session Request\n");
printf("%s -> %s\n", FILENAME, __func__);
}
void eDVBCISession::deleteSessions(const tSlot *slot)
{
printf("%s -> %s\n", FILENAME, __func__);
for (unsigned short session_nb = 0; session_nb < SLMS; ++session_nb)
{
if (sessions[session_nb] && sessions[session_nb]->slot == slot)
@@ -132,11 +134,13 @@ eDVBCISession* eDVBCISession::createSession(tSlot *slot, const unsigned char *re
unsigned long tag;
unsigned short session_nb;
printf("%s -> %s\n", FILENAME, __func__);
for (session_nb = 1; session_nb < SLMS; ++session_nb)
if (!sessions[session_nb - 1])
break;
printf("use session_nb = %d\n", session_nb);
printf("%s -> use session_nb = %d\n", FILENAME, session_nb);
if (session_nb == SLMS)
{
status = 0xF3;
@@ -148,7 +152,7 @@ eDVBCISession* eDVBCISession::createSession(tSlot *slot, const unsigned char *re
tag |= resource_identifier[2] << 8;
tag |= resource_identifier[3];
printf("Tag: %08lx\n", tag);
printf("Tag: %08lx > ", tag);
switch (tag)
{
@@ -170,14 +174,14 @@ eDVBCISession* eDVBCISession::createSession(tSlot *slot, const unsigned char *re
printf("DATE-TIME\n");
break;
case 0x00400041:
printf("MMI\n");
sessions[session_nb - 1] = new eDVBCIMMISession(slot);
printf("MMI - create session\n");
break;
if (cCA::GetInstance()->CheckCerts())
{
case 0x008c1001:
sessions[session_nb - 1] = new eDVBCIContentControlManagerSession(slot);
printf("CC MANAGER\n");
sessions[session_nb - 1] = new eDVBCIContentControlManagerSession(slot);
break;
}
case 0x00100041:
@@ -197,7 +201,7 @@ eDVBCISession* eDVBCISession::createSession(tSlot *slot, const unsigned char *re
return NULL;
}
printf("new session nb %d %p\n", session_nb, sessions[session_nb - 1]);
printf("%s -> new session nb %d %p\n", FILENAME, session_nb, sessions[session_nb - 1]);
sessions[session_nb - 1]->session_nb = session_nb;
if (sessions[session_nb - 1])
@@ -235,7 +239,6 @@ int eDVBCISession::pollAll()
if (r)
{
printf("%s <\n", __func__);
return 1;
}
}