Changeset 4141 for trunk/reader-viaccess.c
- Timestamp:
- 12/18/10 08:10:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-viaccess.c
r4115 r4141 327 327 { 328 328 nanoD2 = 1; 329 cs_debug ("[viaccess-reader] ECM: nano D2 0x0b");329 cs_debug_mask(D_READER, "[viaccess-reader] ECM: nano D2 0x0b"); 330 330 } 331 331 if(ecm88Data[2]==0x0d) 332 332 { 333 333 nanoD2 = 2; 334 cs_debug ("[viaccess-reader] ECM: nano D2 0x0d");334 cs_debug_mask(D_READER, "[viaccess-reader] ECM: nano D2 0x0d"); 335 335 } 336 336 // use the d2 arguments to get the key # to be used … … 362 362 if(nanoLen>5) { 363 363 curnumber_ecm =(ecm88Data[6]<<8) | (ecm88Data[7]); 364 cs_debug ("checking if the ecm number (%x) match the card one (%x)",curnumber_ecm,reader->last_geo.number_ecm);364 cs_debug_mask(D_READER, "checking if the ecm number (%x) match the card one (%x)",curnumber_ecm,reader->last_geo.number_ecm); 365 365 // if we have an ecm number we check it. 366 366 // we can't assume that if the nano len is 5 or more we have an ecm number … … 369 369 if(reader->last_geo.number_ecm ==curnumber_ecm ) { 370 370 keynr=ecm88Data[5]; 371 cs_debug ("keyToUse = %02x",ecm88Data[5]);371 cs_debug_mask(D_READER, "keyToUse = %02x",ecm88Data[5]); 372 372 } 373 373 else … … 380 380 else { // long ecm but we don't have an ecm number so we have to try them all. 381 381 keynr=ecm88Data[5]; 382 cs_debug ("keyToUse = %02x",ecm88Data[5]);382 cs_debug_mask(D_READER, "keyToUse = %02x",ecm88Data[5]); 383 383 } 384 384 } … … 398 398 if (!chk_prov(reader, ident, keynr)) 399 399 { 400 cs_debug ("[viaccess-reader] ECM: provider or key not found on card");400 cs_debug_mask(D_READER, "[viaccess-reader] ECM: provider or key not found on card"); 401 401 snprintf( er->msglog, MSGLOGSIZE, "provider(%02x%02x%02x) or key(%d) not found on card", ident[0],ident[1],ident[2], keynr ); 402 402 return ERROR; … … 443 443 if(reader->aes_list) 444 444 { 445 cs_debug ("Decoding CW : using AES key id %d for provider %06x",D2KeyID, (provid & 0xFFFFF0));445 cs_debug_mask(D_READER, "Decoding CW : using AES key id %d for provider %06x",D2KeyID, (provid & 0xFFFFF0)); 446 446 rc=aes_decrypt_from_list(reader->aes_list,0x500, (uint32) (provid & 0xFFFFF0), D2KeyID, &ecm88DataCW[0], 16); 447 447 if( rc == 0 ) … … 509 509 ecm88Data=nextEcm; 510 510 ecm88Len-=curEcm88len; 511 cs_debug ("[viaccess-reader] ECM: key to use is not the current one, trying next ECM");511 cs_debug_mask(D_READER, "[viaccess-reader] ECM: key to use is not the current one, trying next ECM"); 512 512 snprintf( er->msglog, MSGLOGSIZE, "key to use is not the current one, trying next ECM" ); 513 513 } … … 516 516 ecm88Data=nextEcm; 517 517 ecm88Len-=curEcm88len; 518 cs_debug ("[viaccess-reader] ECM: Unknown ECM type");518 cs_debug_mask(D_READER, "[viaccess-reader] ECM: Unknown ECM type"); 519 519 snprintf( er->msglog, MSGLOGSIZE, "Unknown ECM type" ); 520 520 } … … 523 523 if ( hasD2 && !check_crc(er->cw) && nanoD2 == 2) { 524 524 if(reader->aes_list) { 525 cs_debug ("Decoding CW : using AES key id %d for provider %06x",D2KeyID, (provid & 0xFFFFF0));525 cs_debug_mask(D_READER, "Decoding CW : using AES key id %d for provider %06x",D2KeyID, (provid & 0xFFFFF0)); 526 526 rc=aes_decrypt_from_list(reader->aes_list,0x500, (uint32) (provid & 0xFFFFF0), D2KeyID,er->cw, 16); 527 527 if( rc == 0 ) … … 662 662 provider_ok = 1; 663 663 } else { 664 cs_debug ("[viaccess-reader] EMM: provider or key not found on card (%x, %x)", ident, keynr);664 cs_debug_mask(D_READER, "[viaccess-reader] EMM: provider or key not found on card (%x, %x)", ident, keynr); 665 665 cs_log("[viaccess-reader] EMM: provider or key not found on card (%x, %x)", ident, keynr); 666 666 return ERROR; … … 696 696 697 697 if( afd[31-custwp/8] & (1 << (custwp & 7)) ) 698 cs_debug ("[viaccess-reader] emm for our card %08X", b2i(4, &reader->sa[0][0]));698 cs_debug_mask(D_READER, "[viaccess-reader] emm for our card %08X", b2i(4, &reader->sa[0][0])); 699 699 else 700 700 return SKIPPED; … … 724 724 725 725 if (!provider_ok) { 726 cs_debug ("[viaccess-reader] provider not found in emm, continue anyway");726 cs_debug_mask(D_READER, "[viaccess-reader] provider not found in emm, continue anyway"); 727 727 // force key to 1... 728 728 keynr = 1; … … 772 772 write_cmd(ins18, insData); 773 773 if( (cta_res[cta_lr-2]==0x90 || cta_res[cta_lr-2]==0x91) && cta_res[cta_lr-1]==0x00 ) { 774 cs_debug ("[viaccess-reader] update successfully written");774 cs_debug_mask(D_READER, "[viaccess-reader] update successfully written"); 775 775 rc=1; // written 776 776 } else { … … 953 953 memcpy(emm_global, buffer, *len); 954 954 emm_global_len=*len; 955 //cs_ddump (buffer, len, "viaccess global emm:");955 //cs_ddump_mask(D_READER, buffer, len, "viaccess global emm:"); 956 956 return 0; 957 957 … … 991 991 emm_len=pos; 992 992 emmbuf[2]=emm_len-3; 993 cs_ddump (buffer, *len, "original emm:");993 cs_ddump_mask(D_READER, buffer, *len, "original emm:"); 994 994 memcpy(buffer, emmbuf, emm_len); 995 995 *len=emm_len;
Note:
See TracChangeset
for help on using the changeset viewer.