OSCAM with No CW Swap for 09CD

gb21063

Registered
Messages
11
CW OK => 6045640931EE7C9B0000000000000000 => count 11
CW BAD => 0000000000000000F6488AC8076BB123 => count 13

Oscam swap the cw from 0000000000000000F6488AC8076BB123 to this
2014/02/08 01:01:34 E04F1DF0 c dreambox (09CD&000000/04C0/2BD0/B7/F8BFE7EC/F6488AC8076BB1230000000000000000): cache3 (220 ms) by peerA (cw count 11)


give cw OK but cw is not valid, result 10 second freeze. Without swap the cyclecheck will detect the invalid cw, and goes to another reader. Normaly this happens, but in cwc if the 0 byte of cw is not right, oscam gives a cwc IGN without asking another reader:

2014/02/10 23:57:33 1A938E0 c dreambox (09CD:000000:2CBF/B7/086083FC/0F50E24188ACDE120000000000000000): cache3 (221 ms) by Cache (C/1/4/12) - Juventus Channel (cwc *** OK)
2014/02/10 23:57:43 1A938E0 c dreambox (09CD:000000:2CBF/B7/9D2A27A0/CC9B8FF624A3C88F0000000000000000): cache3 (220 ms) by Cache (C/1/4/12) - Juventus Channel (cwc *** IGN)

(cwc *** IGN) should be (cwc *** NOK) to ask another reader.
2014/02/10 11:21:53 C053B60 p cyclecheck [Bad CW Cycle] for: dreambox 09CD&000000/3C03/B7/F8BFE7EC/0000000000000000F6488AC8076BB123 from: Cache -> drop cw (ECM Answer)


Use this two patches to resolve this:


Download Patch

cd /usr/src/oscam-svn
wget http://docs.homelinux.org/downloads/09CD_no_cw_swap.patch
patch -p0 < 09CD_no_cw_swap.patch
wget http://docs.homelinux.org/downloads/09CD_no_cw_swap_cwc.patch
patch -p0 < 09CD_no_cw_swap_cwc.patch


Sources

09CD_no_cw_swap.patch
--- oscam-ecm.orig 2014-02-10 09:58:06.550796453 +0100
+++ oscam-ecm.c 2014-02-10 09:58:57.000000000 +0100
@@ -1049,7 +1049,7 @@
er->rc = E_FOUND;
}

- if (er->caid **** 8 == 0x09 && er->cw && er->rc < E_NOTFOUND){
+ if (er->caid **** 8 == 0x09 && er->cw && er->rc < E_NOTFOUND && er->caid != 0x09CD){
if (er->ecm[0] == 0x80 && checkCWpart(er->cw, 1) && !checkCWpart(er->cw, 0)){ // wrong: even ecm should only have even part of cw used
cs_debug_mask(D_TRACE,"*** videoguard controlword swapped");
memcpy(er->cw, er->cw + 8, 8); // move card cw answer to right part!



09CD_no_cw_swap_cwc.patch
--- module-cw-cycle-check.orig 2014-02-11 00:17:42.942556226 +0100
+++ module-cw-cycle-check.c 2014-02-11 00:14:44.000000000 +0100
@@ -714,8 +714,18 @@
client->account->cwcycledchecked++;
client->account->cwcycledign++;
}
- snprintf(er->cwc_msg_log, sizeof(er->cwc_msg_log), "cwc *** IGN");
- return 1;
+
+ if(er->caid == 0x09CD){
+ snprintf(er->cwc_msg_log, sizeof(er->cwc_msg_log), "cwc *** NOK");
+ if(cfg.onbadcycle > 0) // ignore ECM Request
+ {
+ cs_log("cyclecheck [Bad CW Cycle] for: %s %s from: %s -> drop cw (ECM Answer)", user, er_ecmf, c_reader); //D_CWC| D_TRACE
+ return 0;
+ }
+ }else{
+ snprintf(er->cwc_msg_log, sizeof(er->cwc_msg_log), "cwc *** IGN");
+ return 1;
+ }

case 5: //answer from fixed Fallbackreader with Bad Cycle
if(client)
 
Top