Changeset 9827


Ignore:
Timestamp:
08/12/14 23:39:40 (9 years ago)
Author:
theparasol
Message:
  • Reworked viaccess nano e0 detection since the implemented detection was not catching the nano e0 on all channels
  • Added more general way to detect cw's that need additional postprocessing in ecm handler currently seca nano01 & viaccess nano e0 are added and detected
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/oscam-ecm.c

    r9825 r9827  
    16861686                if(cw[i + 3] != c)
    16871687                {
    1688                     bool nano = false;
    1689                     if(er->caid == 0x100 && er->ecm[5] > 0x00){
    1690                         cs_debug_mask(D_TRACE,"NANO%02d: this cw needs additional decryption!", er->ecm[5]);
    1691                         nano = true;
     1688                    unsigned char nano = 0x00;
     1689                    if(er->caid == 0x100 && er->ecm[5] > 0x00)
     1690                    {
     1691                        nano = er->ecm[5]; // seca nano protection
    16921692                    }
    1693                     if(reader->dropbadcws && !nano)
     1693                    if(er->caid == 0x500)
     1694                    {
     1695                        //search for nano E0
     1696                        int16_t s;
     1697                        for (s = 0; s < er->ecmlen-3 && (er->ecm[s] != 0xE0 && er->ecm[s+1] != 0x02 && er->ecm[s+2] != 0x00 && er->ecm[s+3] != 0x02) ; s++)
     1698                        {
     1699                            nano = er->ecm[s]; // viaccess nano protection
     1700                        }
     1701                    }   
     1702                       
     1703                    if(reader->dropbadcws && !nano) // only drop controlword if no cw encryption is applied
    16941704                    {
    16951705                        rc = E_NOTFOUND;
     
    16991709                    else
    17001710                    {
    1701                         if(!nano)
     1711                        if(!nano) // only fix checksum if no cw encryption is applied
    17021712                        {
    17031713                            cs_debug_mask(D_TRACE, "notice: changed dcw checksum byte cw[%i] from %02x to %02x", i + 3, cw[i + 3], c);
     
    17061716                        else
    17071717                        {
    1708                             cs_debug_mask(D_TRACE,"NANO%02d: not fixing the crc of this cw since its still encrypted!", er->ecm[5]);
     1718                            cs_debug_mask(D_TRACE,"NANO%02d: not fixing the crc of this cw since its still encrypted!", nano);
    17091719                        }
    17101720                    }
  • trunk/reader-viaccess.c

    r9652 r9827  
    939939
    940940    nextEcm = ecm88Data;
    941  
    942  //looking for nano E0
    943             while (ecm88Len)
    944             {
    945                 // 80 33 nano 80 (ecm) + len (33)
    946                 if(ecm88Data[0]==0x80) { // nano 80, give ecm len
    947                     curEcm88len=ecm88Data[1];
    948                     nextEcm=ecm88Data+curEcm88len+2;
    949                     ecm88Data += 2;
    950                     ecm88Len -= 2;
    951          
    952                     if (ecm88Data[0]==0x90  && ecm88Data[1]==0x07)
    953                     {
    954                         curnumber_ecm =(ecm88Data[6]<<8) | (ecm88Data[7]);
    955                         //if number_ecm & nano E0 ecm  not suported
    956                         if ((ecm88Data[9] == 0xE0) && (ecm88Data[10] == 0x02))
    957                         {
    958                             cs_log("[viaccess-reader] ECM: Invalid ECM nano E0 Rejecting");
    959                             return ERROR;
    960                         }
    961                     }
    962                     ecm88Data=nextEcm;
    963                     ecm88Len-=curEcm88len;
    964                     continue; //loop to next ecm
    965                 } else  ecm88Len = 0; //exit while
    966             }
    967          
    968             //reset to beginning of ECM
    969             ecm88Data=&ecmData[0]; //XXX what is the 4th byte for ??
    970             ecm88Len=SCT_LEN(er->ecm)-4;
    971             curEcm88len=0;
    972             nextEcm=ecm88Data;
    973 
    974941
    975942    while(ecm88Len > 0 && !rc)
     
    11201087                ecm88Data += 6;
    11211088            }
    1122             //
     1089           
     1090            // E0
     1091            if(ecm88Data[0] == 0xE0 && ecm88Data[1] == 0x02 && ecm88Data[2] == 0x00 && ecm88Data[3] == 0x02)
     1092            {
     1093                cs_log("[viaccess-reader] ECM: This ECM is using nano E0 -> skip since preprocessing / postprocessing is unknown!");
     1094                ecm88Data = nextEcm;
     1095                ecm88Len -= curEcm88len;
     1096                continue;
     1097            }
     1098           
    11231099
    11241100            if(csystem_data->last_geo.provid != provid)
     
    12451221                ecm88Data = nextEcm;
    12461222                ecm88Len -= curEcm88len;
    1247                 rdr_debug_mask(reader, D_READER, "ECM: key to use is not the current one, trying next ECM");
     1223                rdr_debug_mask(reader, D_READER, "Error: card respondend %02X %02X, trying next ECM", cta_res[0], cta_res[1]);
    12481224                snprintf(ea->msglog, MSGLOGSIZE, "key to use is not the current one, trying next ECM");
    12491225            }
Note: See TracChangeset for help on using the changeset viewer.