From fe8b1237ac58ef91e7687e1a2a0baec6b7246ee0 Mon Sep 17 00:00:00 2001 From: max10 Date: Tue, 10 Nov 2015 15:55:48 +0100 Subject: [PATCH] test c** --- common/ca_ci.cpp | 16 +------------ libdvbci/descrambler.cpp | 50 ++++++++-------------------------------- 2 files changed, 11 insertions(+), 55 deletions(-) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index 576e0a9..06db18f 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -31,8 +31,6 @@ #define x_debug 1 #define y_debug 0 -#define tricky 0 - #define TAG_MENU_ANSWER 0x9f880b #define TAG_ENTER_MENU 0x9f8022 @@ -996,13 +994,6 @@ void cCA::slot_pollthread(void *c) printf("r = %d, %m\n", res); } } - /* no comment :) */ -#if tricky - if ((!checkQueueSize(slot) && !slot->hasCAManager && !slot->ccmgr_ready) || slot->counter < 3) - slot->pollConnection = true; - if (slot->hasCAManager && slot->ccmgr_ready) - slot->counter++; -#else /* check for activate the pollConnection */ if (!checkQueueSize(slot) && (slot->DataRCV || slot->mmiOpened || slot->counter > 5)) { @@ -1012,7 +1003,6 @@ void cCA::slot_pollthread(void *c) slot->counter++; else slot->counter = 0; -#endif /* if Flag: send a DataLast */ if (!checkQueueSize(slot) && slot->pollConnection && slot->DataLast) { @@ -1147,11 +1137,7 @@ void cCA::slot_pollthread(void *c) /* not necessary: the arrived capmt will be automaticly send */ //SendCaPMT(slot); } - if (slot->hasCAManager && slot->hasAppManager && slot->newCapmt -#if tricky - && slot->ccmgr_ready -#endif - ) + if (slot->hasCAManager && slot->hasAppManager && slot->newCapmt) { SendCaPMT(slot); slot->newCapmt = false; diff --git a/libdvbci/descrambler.cpp b/libdvbci/descrambler.cpp index e01c10f..83a6a66 100644 --- a/libdvbci/descrambler.cpp +++ b/libdvbci/descrambler.cpp @@ -11,60 +11,30 @@ static const char * FILENAME = "[descrambler]"; -/* alles im Kernel Header ca.h definiert da es der player2 auch braucht - -enum ca_descr_data_type { - CA_DATA_IV, - CA_DATA_KEY, -}; - -enum ca_descr_parity { - CA_PARITY_EVEN, - CA_PARITY_ODD, -}; - -struct ca_descr_data { - unsigned int index; - enum ca_descr_parity parity; - enum ca_descr_data_type data_type; - unsigned int length; - unsigned char *data; -}; -#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data) - -*/ - static int desc_fd; +/* Byte 0 to 15 are AES Key, Byte 16 to 31 are IV */ + int descrambler_set_key(int index, int parity, unsigned char *data) { struct ca_descr_data d; printf("%s -> %s\n", FILENAME, __FUNCTION__); + + d.index = index; d.parity = (ca_descr_parity)parity; d.data_type = CA_DATA_KEY; - d.length = 16; + d.length = 32; d.data = data; - printf("Index: %d Parity: %d Type CA_DATA_KEY= %d\n", d.index, d.parity, d.data_type); - hexdump(d.data, 16); + printf("Index: %d Parity: (%d) -> ", d.index, d.parity); + hexdump(d.data, 32); if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d)) - printf("CA_SET_DESCR_DATA\n"); - - d.index = index; - d.parity = (ca_descr_parity)parity; - d.data_type = CA_DATA_IV; - d.length = 16; - d.data = data + 16; - - printf("Index: %d Parity: %d Type CA_DATA_IV= %d\n", d.index, d.parity, d.data_type); - hexdump(d.data, 16); - - if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d)) - printf("CA_SET_DESCR_DATA\n"); - + { + //printf("CA_SET_DESCR_DATA\n"); + } return 0; }