Changeset 3128
- Timestamp:
- 09/21/10 15:32:07 (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-videoguard-common.c
r3124 r3128 120 120 static void cCamCryptVG_Process_D1(const unsigned char *ins, unsigned char *data, const unsigned char *status); 121 121 static void cCamCryptVG_Decrypt_D3(unsigned char *ins, unsigned char *data, const unsigned char *status); 122 static void cCamCryptVG_PostProcess_Decrypt( unsigned char *buff, int len, unsigned char *cw);122 static void cCamCryptVG_PostProcess_Decrypt(struct s_reader * reader, unsigned char *buff, int len, unsigned char *cw); 123 123 124 124 struct CmdTab *cmd_table=NULL; … … 205 205 } 206 206 207 static void cCamCryptVG_PostProcess_Decrypt( unsigned char *rxbuff, int len, unsigned char *cw)207 static void cCamCryptVG_PostProcess_Decrypt(struct s_reader * reader, unsigned char *rxbuff, int len, unsigned char *cw) 208 208 { 209 209 switch(rxbuff[0]) { … … 223 223 // we start searching at 15 because start at 13 goes wrong with 090F 090b and 096a 224 224 if(rxbuff[ind]==0x25) { 225 //memcpy(cw2,rxbuff+5+ind+2,8);226 225 memcpy(cw+8,rxbuff+ind+3,8); //tested on viasat 093E, sky uk 0963, sky it 919 //don't care whether cw is 0 or not 227 226 break; 228 227 } 229 /* if(rxbuff[ind+1]==0) break;230 ind+=rxbuff[ind+1];*/231 228 } 229 // fix for 09ac cards 230 // Log decrypted INS54 231 // if (rxbuff[1] == 0x54) { 232 // cs_dump (rxbuff, 5, "Decrypted INS54:"); 233 // cs_dump (rxbuff + 5, rxbuff[4], ""); 234 //} 235 manage_tag(reader, rxbuff, cw); 232 236 } 233 237 break; … … 451 455 } 452 456 453 void manage_tag( unsigned char *rxbuff, unsigned char *cw)457 void manage_tag(struct s_reader * reader, unsigned char *rxbuff, unsigned char *cw) 454 458 { 455 459 unsigned char tag,len,len2; … … 478 482 } 479 483 if(valid_0x55){ 480 memcpy(buffer,rxbuff+5,8); //Copy original CW 481 AES_decrypt(buffer,buffer,&Astro_Key); //Astro_Key declared and filled before... 482 memcpy(cw+0,buffer,8); //Now copy calculated CW in right place 484 memcpy(buffer,rxbuff+5,8); 485 if(aes_decrypt_from_list(reader->aes_list,reader->caid[0], 0, AESKEY_ASTRO,buffer, 16)) { 486 memcpy(cw+0,buffer,8); // copy calculated CW in right place 487 } 483 488 } 484 489 } … … 555 560 } 556 561 557 cCamCryptVG_PostProcess_Decrypt(rxbuff,len,cw); 558 559 // Start of suggested fix for 09ac cards 560 // Log decrypted INS54 561 ///if (rxbuff[1] == 0x54) { 562 /// cs_dump (rxbuff, 5, "Decrypted INS54:"); 563 /// cs_dump (rxbuff + 5, rxbuff[4], ""); 564 ///} 565 566 manage_tag(rxbuff, cw); 567 // End of suggested fix 562 cCamCryptVG_PostProcess_Decrypt(reader, rxbuff,len,cw); 563 564 // manage_tag(reader, rxbuff, cw); moved into cCamCryptVG_PostProcess_Decrypt as only needed on classD3 ins54 565 568 566 return len; 569 567 } -
trunk/reader-videoguard-common.h
r3114 r3128 23 23 #define NDS2 2 24 24 25 #define AESKEY_ASTRO 1 26 27 25 28 typedef struct nds_atr { 26 29 uchar atr[MAX_ATR_LEN]; … … 31 34 } NDS_ATR_ENTRY; 32 35 33 AES_KEY dkey, ekey , Astro_Key;36 AES_KEY dkey, ekey; 34 37 35 38 extern int io_serial_need_dummy_char; … … 65 68 66 69 extern void do_post_dw_hash(unsigned char *cw, unsigned char *ecm_header_data); 67 extern void manage_tag( unsigned char *answer, unsigned char *cw);70 extern void manage_tag(struct s_reader * reader, unsigned char *answer, unsigned char *cw); 68 71 extern int status_ok(const unsigned char *status); 69 72 -
trunk/reader-videoguard12.c
r3114 r3128 201 201 return ERROR; 202 202 } 203 // Start of suggested fix for 09ac cards204 unsigned char Dimeno_Magic[0x10]={0xF9,0xFB,0xCD,0x5A,0x76,0xB5,0xC4,0x5C,0xC8,0x2E,0x1D,0xE1,0xCC,0x5B,0x6B,0x02};205 int a;206 for(a=0; a<4; a++)207 Dimeno_Magic[a]=Dimeno_Magic[a]^boxID[a];208 //I supposed to declare a AES_KEY Astro_Key somewhere before...209 AES_set_decrypt_key(Dimeno_Magic,128,&Astro_Key);210 Astro_Key.rounds=10;211 //Important for ecm decryption...212 // End of suggested fix213 203 214 204 //short int SWIRDstatus = cta_res[1]; … … 285 275 return ERROR; 286 276 } 277 278 // fix for 09ac cards 279 unsigned char dimeno_magic[0x10]={0xF9,0xFB,0xCD,0x5A,0x76,0xB5,0xC4,0x5C,0xC8,0x2E,0x1D,0xE1,0xCC,0x5B,0x6B,0x02}; 280 int a; 281 for(a=0; a<4; a++) 282 dimeno_magic[a]=dimeno_magic[a]^boxID[a]; 283 add_aes_entry(reader, reader->caid[0], 0, AESKEY_ASTRO, dimeno_magic); 284 285 AES_ENTRY *current; 286 current=reader->aes_list; 287 while(current) { 288 cs_log("**************************"); 289 cs_log("current = %p",current); 290 cs_log("CAID = %04x",current->caid); 291 cs_log("IDENT = %06x",current->ident); 292 cs_log("keyID = %d",current->keyid); 293 cs_log("next = %p",current->next); 294 cs_log("**************************"); 295 current=current->next; 296 } 287 297 288 298 cs_ri_log(reader, "[videoguard12-reader] type: VideoGuard, caid: %04X, serial: %02X%02X%02X%02X, BoxID: %02X%02X%02X%02X", -
trunk/reader-videoguard2.c
r3124 r3128 263 263 for(a=0; a<4; a++) 264 264 dimeno_magic[a]=dimeno_magic[a]^boxID[a]; 265 // I supposed to declare a AES_KEY Astro_Key somewhere before... 266 AES_set_decrypt_key(dimeno_magic,128,&Astro_Key); 267 Astro_Key.rounds=10; //Important for ecm decryption... 265 add_aes_entry(reader, reader->caid[0], 0, AESKEY_ASTRO, dimeno_magic); 266 267 AES_ENTRY *current; 268 current=reader->aes_list; 269 while(current) { 270 cs_log("**************************"); 271 cs_log("current = %p",current); 272 cs_log("CAID = %04x",current->caid); 273 cs_log("IDENT = %06x",current->ident); 274 cs_log("keyID = %d",current->keyid); 275 cs_log("next = %p",current->next); 276 cs_log("**************************"); 277 current=current->next; 278 } 268 279 269 280 cs_ri_log(reader, "[videoguard2-reader] type: %s, caid: %04X, serial: %02X%02X%02X%02X, BoxID: %02X%02X%02X%02X",
Note:
See TracChangeset
for help on using the changeset viewer.