mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
test c**
Origin commit data
------------------
Branch: master
Commit: f7b22b485d
Author: max_10 <max_10@gmx.de>
Date: 2015-11-13 (Fri, 13 Nov 2015)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -643,6 +643,7 @@ SlotIt cCA::FindFreeSlot(ca_map_t camap, unsigned char scrambled)
|
|||||||
printf("%04x ", (*it)->cam_caids[i]);
|
printf("%04x ", (*it)->cam_caids[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
(*it)->scrambled = scrambled;
|
||||||
if (scrambled)
|
if (scrambled)
|
||||||
{
|
{
|
||||||
for (i = 0; i < (*it)->cam_caids.size(); i++)
|
for (i = 0; i < (*it)->cam_caids.size(); i++)
|
||||||
@@ -666,7 +667,7 @@ SlotIt cCA::FindFreeSlot(ca_map_t camap, unsigned char scrambled)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* erstmal den capmt wie er von Neutrino kommt in den Slot puffern */
|
/* erstmal den capmt wie er von Neutrino kommt in den Slot puffern */
|
||||||
bool cCA::SendCAPMT(u64 tpid, u8 source_demux, u8 camask, const unsigned char * cabuf, u32 calen, const unsigned char * /*rawpmt*/, u32 /*rawlen*/, enum CA_SLOT_TYPE SlotType, unsigned char scrambled, ca_map_t cm, int mode, bool enabled)
|
bool cCA::SendCAPMT(u64 tpid, u8 source_demux, u8 camask, const unsigned char * cabuf, u32 calen, const unsigned char * /*rawpmt*/, u32 /*rawlen*/, enum CA_SLOT_TYPE /*SlotType*/, unsigned char scrambled, ca_map_t cm, int mode, bool enabled)
|
||||||
{
|
{
|
||||||
printf("%s -> %s\n", FILENAME, __func__);
|
printf("%s -> %s\n", FILENAME, __func__);
|
||||||
if (!num_slots) return true; /* stb's without ci-slots */
|
if (!num_slots) return true; /* stb's without ci-slots */
|
||||||
@@ -1141,6 +1142,13 @@ void cCA::slot_pollthread(void *c)
|
|||||||
{
|
{
|
||||||
SendCaPMT(slot);
|
SendCaPMT(slot);
|
||||||
slot->newCapmt = false;
|
slot->newCapmt = false;
|
||||||
|
if (slot->ccmgr_ready && slot->hasCCManager)
|
||||||
|
{
|
||||||
|
if (slot->scrambled)
|
||||||
|
{
|
||||||
|
slot->ccmgrSession->resendKey(slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -203,6 +203,9 @@ typedef struct
|
|||||||
CaIdVector cam_caids;
|
CaIdVector cam_caids;
|
||||||
std::priority_queue<queueData> sendqueue;
|
std::priority_queue<queueData> sendqueue;
|
||||||
|
|
||||||
|
unsigned char lastKey[32];
|
||||||
|
unsigned char scrambled;
|
||||||
|
u8 lastParity;
|
||||||
bool DataLast;
|
bool DataLast;
|
||||||
bool DataRCV;
|
bool DataRCV;
|
||||||
/* private data */
|
/* private data */
|
||||||
|
@@ -21,6 +21,7 @@ int descrambler_set_key(int index, int parity, unsigned char *data)
|
|||||||
|
|
||||||
printf("%s -> %s\n", FILENAME, __FUNCTION__);
|
printf("%s -> %s\n", FILENAME, __FUNCTION__);
|
||||||
|
|
||||||
|
index |= 0x100;
|
||||||
|
|
||||||
d.index = index;
|
d.index = index;
|
||||||
d.parity = (ca_descr_parity)parity;
|
d.parity = (ca_descr_parity)parity;
|
||||||
@@ -56,7 +57,7 @@ int descrambler_set_pid(int index, int enable, int pid)
|
|||||||
|
|
||||||
int descrambler_init(void)
|
int descrambler_init(void)
|
||||||
{
|
{
|
||||||
const char *filename = "/dev/dvb/adapter0/ca1";
|
const char *filename = "/dev/dvb/adapter0/ca3";
|
||||||
|
|
||||||
printf("%s -> %s\n", FILENAME, __FUNCTION__);
|
printf("%s -> %s\n", FILENAME, __FUNCTION__);
|
||||||
|
|
||||||
|
@@ -869,9 +869,14 @@ static void check_new_key(struct cc_ctrl_data *cc_data)
|
|||||||
AES_ecb_encrypt(&kp[i], &dec[i], &aes_ctx, 1);
|
AES_ecb_encrypt(&kp[i], &dec[i], &aes_ctx, 1);
|
||||||
|
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
|
{
|
||||||
dec[i] ^= kp[i];
|
dec[i] ^= kp[i];
|
||||||
|
cc_data->slot->lastKey[i] = dec[i];
|
||||||
|
}
|
||||||
|
cc_data->slot->lastParity = slot;
|
||||||
|
|
||||||
descrambler_set_key((int)cc_data->slot->source, slot, dec);
|
if (cc_data->slot->scrambled)
|
||||||
|
cc_data->slot->ccmgrSession->resendKey(cc_data->slot);
|
||||||
|
|
||||||
/* reset */
|
/* reset */
|
||||||
element_invalidate(cc_data, 12);
|
element_invalidate(cc_data, 12);
|
||||||
@@ -1268,8 +1273,8 @@ void eDVBCIContentControlManagerSession::ci_ccmgr_doClose(tSlot *tslot)
|
|||||||
printf("close content_control\n");
|
printf("close content_control\n");
|
||||||
for (int i = 0; i < 32; i++)
|
for (int i = 0; i < 32; i++)
|
||||||
clearData[i] = 0;
|
clearData[i] = 0;
|
||||||
descrambler_set_key(data->slot->slot, 0, clearData);
|
descrambler_set_key((int)data->slot->source, 0, clearData);
|
||||||
descrambler_set_key(data->slot->slot, 1, clearData);
|
descrambler_set_key((int)data->slot->source, 1, clearData);
|
||||||
|
|
||||||
descrambler_deinit();
|
descrambler_deinit();
|
||||||
|
|
||||||
@@ -1319,3 +1324,9 @@ int eDVBCIContentControlManagerSession::doAction()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void eDVBCIContentControlManagerSession::resendKey(tSlot *tslot)
|
||||||
|
{
|
||||||
|
descrambler_set_key((int)tslot->source, tslot->lastParity, tslot->lastKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -22,5 +22,6 @@ public:
|
|||||||
eDVBCIContentControlManagerSession(tSlot *tslot);
|
eDVBCIContentControlManagerSession(tSlot *tslot);
|
||||||
~eDVBCIContentControlManagerSession();
|
~eDVBCIContentControlManagerSession();
|
||||||
void ci_ccmgr_doClose(tSlot *tslot);
|
void ci_ccmgr_doClose(tSlot *tslot);
|
||||||
|
void resendKey(tSlot *tslot);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user