Changeset 1389 for trunk/reader-irdeto.c
- Timestamp:
- 01/31/10 19:48:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-irdeto.c
r1381 r1389 2 2 #include "reader-common.h" 3 3 4 extern uchar cta_ cmd[], cta_res[];4 extern uchar cta_res[]; 5 5 extern ushort cta_lr; 6 6 … … 151 151 #define reader_chk_cmd(cmd, l) \ 152 152 { \ 153 if (reader_cmd2icc(cmd, sizeof(cmd))) return(0); \ 154 if (l && (cta_lr!=l)) return(0); } 155 156 int irdeto_card_init(uchar *atr) 157 { 153 if (reader_cmd2icc(cmd, sizeof(cmd))) return ERROR; \ 154 if (l && (cta_lr!=l)) return ERROR; } 155 156 int irdeto_card_init(ATR newatr) 157 { 158 get_atr; 158 159 int i, camkey=0, cs_ptyp_orig=cs_ptyp; 159 160 uchar buf[256]={0}; 160 161 161 162 if (memcmp(atr+4, "IRDETO", 6)) 162 return (0);163 return ERROR; 163 164 cs_ri_log("[irdeto-reader] detect Irdeto card"); 164 165 … … 255 256 if (reader[ridx].cardmhz != 600) 256 257 cs_log("WARNING: For irdeto cards you will have to set 'cardmhz = 600' in oscam.server"); 257 return (1);258 return OK; 258 259 } 259 260 … … 261 262 { 262 263 static const uchar sc_EcmCmd[] = { 0x05, 0x00, 0x00, 0x02, 0x00 }; 264 uchar cta_cmd[272]; 263 265 264 266 memcpy(cta_cmd, sc_EcmCmd, sizeof(sc_EcmCmd)); 265 267 cta_cmd[4]=(er->ecm[2])-3; 266 268 memcpy(cta_cmd+sizeof(sc_EcmCmd), &er->ecm[6], cta_cmd[4]); 267 if (irdeto_do_cmd(cta_cmd, 0x9D00)) return (0);268 if (cta_lr<24) return (0);269 if (irdeto_do_cmd(cta_cmd, 0x9D00)) return ERROR; 270 if (cta_lr<24) return ERROR; 269 271 ReverseSessionKeyCrypt(sc_CamKey, cta_res+6); 270 272 ReverseSessionKeyCrypt(sc_CamKey, cta_res+14); 271 273 memcpy(er->cw, cta_res+6, 16); 272 return (1);274 return OK; 273 275 } 274 276 … … 276 278 { 277 279 static const uchar sc_EmmCmd[] = { 0x01,0x00,0x00,0x00,0x00 }; 280 uchar cta_cmd[272]; 278 281 279 282 int i, l=(ep->emm[3]&0x07), ok=0; … … 316 319 cs_debug("[irdeto-reader] addrlen %d > %d", l, ADDRLEN); 317 320 } 318 return (0);321 return ERROR; 319 322 } 320 323 … … 323 326 int i, p; 324 327 uchar buf[256]={0}; 325 uchar sc_GetChid[] = { 0xA0, 0xCA, 0x00, 0x00, 4, 0x22, 1, 5, 0x20};326 328 327 329 /* … … 410 412 } 411 413 cs_log("[irdeto-reader] ready for requests"); 412 return (1);413 } 414 return OK; 415 }
Note:
See TracChangeset
for help on using the changeset viewer.