cwc: return back the key composition - seems like some CA cards returns only single key

This commit is contained in:
Jaroslav Kysela 2014-06-12 15:10:01 +02:00
parent 7f5dff6405
commit da05976c32

View file

@ -143,6 +143,8 @@ typedef struct cwc_service {
ECM_RESET
} ecm_state;
uint8_t cs_even[8];
uint8_t cs_odd[8];
tvhcsa_t cs_csa;
LIST_HEAD(, ecm_pid) cs_pids;
@ -693,6 +695,7 @@ handle_ecm_reply(cwc_service_t *ct, ecm_section_t *es, uint8_t *msg,
int i;
int64_t delay = (getmonoclock() - es->es_time) / 1000LL; // in ms
es->es_pending = 0;
static uint8_t empty[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
snprintf(chaninfo, sizeof(chaninfo), " (PID %d)", es->es_channel);
@ -777,7 +780,12 @@ forbid:
"Obtained key for service \"%s\" in %"PRId64" ms, from %s",
t->s_dvb_svcname, delay, ct->td_nicename);
descrambler_keys((th_descrambler_t *)ct, msg + 3, msg + 3 + 8);
if (memcmp(msg + 3, empty, 8))
memcpy(ct->cs_even, msg + 3, 8);
if (memcmp(msg + 3 + 8, empty, 8))
memcpy(ct->cs_odd, msg + 3 + 8, 8);
descrambler_keys((th_descrambler_t *)ct, ct->cs_even, ct->cs_odd);
ep = LIST_FIRST(&ct->cs_pids);
while(ep != NULL) {