Origin commit data
------------------
Branch: master
Commit: ca27972f16
Author: max_10 <max_10@gmx.de>
Date: 2015-11-15 (Sun, 15 Nov 2015)


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

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2015-11-15 20:29:20 +01:00
parent 5f57aec894
commit 982a650789
5 changed files with 79 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
/* DVB CI Application Manager */
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "dvbci_appmgr.h"
@@ -73,6 +75,7 @@ int eDVBCIApplicationManagerSession::doAction()
const unsigned char tag[3] = {0x9F, 0x80, 0x20};
sendAPDU(tag);
state = stateFinal;
checkBlist();
return 1;
}
case stateFinal:
@@ -102,3 +105,56 @@ int eDVBCIApplicationManagerSession::startMMI()
return 0;
}
bool eDVBCIApplicationManagerSession::readBlist()
{
int rc, i;
char cSid[4] = {0,0,0,0};
u16 Sid;
FILE *fd;
char blacklist_file[32];
sprintf(blacklist_file,"/etc/blacklist_slot_%d",slot->slot);
if (access(blacklist_file, F_OK) != 0)
return false;
fd = fopen(blacklist_file,"r");
if (!fd)
return false;
else
{
do
{
for (i = 0; i < 4; i++)
{
rc = fgetc(fd);
if (rc == ',' || rc == EOF) break;
cSid[i] = (char)rc;
}
if (rc == EOF) goto fin;
if (i == 4)
{
Sid = (u16)strtol(cSid, NULL, 16);
slot->bsids.push_back(Sid);
}
} while (rc != EOF);
fin:
fclose(fd);
}
if (slot->bsids.size())
return true;
else
return false;
}
int eDVBCIApplicationManagerSession::checkBlist()
{
if (readBlist())
{
printf("Blacked sids: %d > ", slot->bsids.size());
for (unsigned int i = 0; i < slot->bsids.size(); i++)
printf("%04x ", slot->bsids[i]);
printf("\n");
}
return 0;
}

View File

@@ -14,6 +14,8 @@ class eDVBCIApplicationManagerSession: public eDVBCISession
int wantmenu;
int receivedAPDU(const unsigned char *tag, const void *data, int len);
int doAction();
bool readBlist();
int checkBlist();
public:
eDVBCIApplicationManagerSession(tSlot *tslot);
~eDVBCIApplicationManagerSession();

View File

@@ -1327,6 +1327,7 @@ int eDVBCIContentControlManagerSession::doAction()
void eDVBCIContentControlManagerSession::resendKey(tSlot *tslot)
{
descrambler_set_key((int)tslot->source, tslot->lastParity, tslot->lastKey);
if (!tslot->SidBlackListed)
descrambler_set_key((int)tslot->source, tslot->lastParity, tslot->lastKey);
}