--- globals.h
+++ globals.h
@@ -393,7 +393,7 @@
#define CS_ECM_RINGBUFFER_MAX 0x10 // max size for ECM last responsetimes ringbuffer. Keep this set to power of 2 values!
// Support for multiple CWs per channel and other encryption algos
-//#define WITH_EXTENDED_CW 1
+#define WITH_EXTENDED_CW 1
#if defined(READER_DRE) || defined(READER_DRECAS) || defined(READER_VIACCESS) || defined(WITH_EMU)
#define MAX_ECM_SIZE 1024
@@ -618,6 +618,7 @@
#define CW_ALGO_CSA 0
#define CW_ALGO_DES 1
#define CW_ALGO_AES128 2
+#define CW_ALGO_CSA_ALT 3
#define CW_ALGO_MODE_ECB 0
#define CW_ALGO_MODE_CBC 1
--- module-dvbapi.c
+++ module-dvbapi.c
@@ -7488,6 +7488,10 @@
cs_sleepms(delay - gone);
}
}
+bool caid_is_alt_csa(uint16_t caid)
+{
+ return caid == 0x09c4 || caid == 0x098c || caid==0x098d;
+}
void dvbapi_send_dcw(struct s_client *client, ECM_REQUEST *er)
{
@@ -7907,6 +7911,17 @@
{
dvbapi_write_cw(i, j, 0, er->cw_ex.session_word, 16, er->cw_ex.data, 16, er->cw_ex.algo, er->cw_ex.algo_mode, er->msgid);
}
+ else if(er->cw_ex.algo == CW_ALGO_CSA)
+ {
+ if((er->ecm[2] - er->ecm[4]) == 4)
+ {
+ if(caid_is_alt_csa(er->caid))
+ {
+ er->cw_ex.algo = CW_ALGO_CSA_ALT;
+ }
+ }
+ dvbapi_write_cw(i, j, 0, er->cw, 8, NULL, 0, er->cw_ex.algo, er->cw_ex.algo_mode, er->msgid);
+ }
else
{
dvbapi_write_cw(i, j, 0, er->cw, 8, NULL, 0, er->cw_ex.algo, er->cw_ex.algo_mode, er->msgid);