Changeset 8458 for trunk/reader-irdeto.c


Ignore:
Timestamp:
03/03/13 12:20:41 (9 years ago)
Author:
gf
Message:

irdeto: Fix EMM filters.

What this commit does:

  • Allow shared to hex serial only for betacrypt. This allows one more free filter slot for Irdeto.
  • Skip not initialised providers. They always have first and third byte 0x00.
  • Improve exit conditions from provider loop. Previous patch could result in memory overwrite.
  • Only display "could not start all emm filters" if we break out of the provider loop. Previously it would display this message even if we haven't skipped emm filters.

Patch by malakudi posted in ticket #3198.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-irdeto.c

    r8442 r8458  
    671671    idx += 32;
    672672
    673     filter[idx++]=EMM_SHARED;
    674     filter[idx++]=0;
    675     filter[idx+0]    = 0x82;
    676     filter[idx+0+16] = 0xFF;
    677     filter[idx+1]    = 0x02;
    678     filter[idx+1+16] = 0x03;
    679     memcpy(filter+idx+2, rdr->hexserial, 2);
    680     memset(filter+idx+2+16, 0xFF, 2);
    681     filter[1]++;
    682     idx += 32;
     673    // Shared on Hex Serial only for Betacrypt
     674    if ( (rdr->caid >> 8) == 0x17 )
     675    {
     676        filter[idx++]=EMM_SHARED;
     677        filter[idx++]=0;
     678        filter[idx+0]    = 0x82;
     679        filter[idx+0+16] = 0xFF;
     680        filter[idx+1]    = 0x02;
     681        filter[idx+1+16] = 0x03;
     682        memcpy(filter+idx+2, rdr->hexserial, 2);
     683        memset(filter+idx+2+16, 0xFF, 2);
     684        filter[1]++;
     685        idx += 32;
     686    }
    683687
    684688    int32_t i;
     689    bool nomorefilters = 0;
    685690    for(i = 0; i < rdr->nprov; i++) {
    686         if (rdr->prid[i][1]==0xFF)
     691        // 00XX00 provider is a not initialised not used provider
     692        if (rdr->prid[i][1]==0xFF || (rdr->prid[i][1]==0x00 && rdr->prid[i][3]==0x00))
    687693            continue;
    688694
     
    698704        idx += 32;
    699705
     706        if (filter[1] == 10) {
     707            nomorefilters = 1;
     708            break;
     709        }
     710
    700711        filter[idx++]=EMM_SHARED;
    701712        filter[idx++]=0;
     
    709720        idx += 32;
    710721
    711         if (filter[1]>=10) {
    712             rdr_log(rdr, "irdeto_get_emm_filter: could not start all emm filter");
     722        if (filter[1] == 10) {
     723            nomorefilters = 1;
    713724            break;
    714725        }
    715726    }
     727
     728    if (nomorefilters)
     729        rdr_log(rdr, "irdeto_get_emm_filter: could not start all emm filters");
    716730
    717731    return;
Note: See TracChangeset for help on using the changeset viewer.