Changeset 2000


Ignore:
Timestamp:
04/07/10 18:42:57 (12 years ago)
Author:
merek
Message:

Make Irdeto demux filter and get_emm_type aware of hexbase in serial to calc the correct EMM nanotype for other irdeto systems with ohter hexbase in serial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-irdeto.c

    r1994 r2000  
    293293
    294294    int l = (ep->emm[3]&0x07);
    295     int mode = (ep->emm[3]>>3);
    296     int type = (ep->emm[3]&0x03);
     295    int base = (ep->emm[3]>>3);
    297296    char dumprdrserial[l*3];
    298297
    299298    cs_debug_mask(D_EMM, "Entered irdeto_get_emm_type ep->emm[3]=%02x",ep->emm[3]);
    300299
    301     switch (type) {
    302 
    303         case 0x00:
    304             // means global emm
     300    switch (l) {
     301
     302        case 0:
     303            // global emm, 0 bytes addressed
    305304            ep->type = GLOBAL;
    306305            cs_debug_mask(D_EMM, "IRDETO EMM: GLOBAL");
    307306            return TRUE;
    308         case 0x02:
    309             // means shared emm, first 2 bytes of hexserial are transmitted in emm, seems to be the shared adr
     307        case 2:
     308            // shared emm, 2 bytes addressed
    310309            ep->type = SHARED;
    311310            memset(ep->hexserial, 0, 8);
     
    315314            return (!l || !memcmp(ep->emm + 4, rdr->hexserial, l));
    316315           
    317         case 0x03:
    318             // means uniqe emm
     316        case 3:
     317            // unique emm, 3 bytes addressed
    319318            ep->type = UNIQUE;
    320319            memset(ep->hexserial, 0, 8);
     
    322321            strcpy(dumprdrserial, cs_hexdump(1, rdr->hexserial, l));
    323322            cs_debug_mask(D_EMM, "IRDETO EMM: UNIQUE, l = %d, ep = %s , rdr = %s", l, cs_hexdump(1, ep->hexserial, l), dumprdrserial);
    324             return (mode == rdr->hexserial[3] && (!l || !memcmp(ep->emm + 4, rdr->hexserial, l)));
     323            return (base == rdr->hexserial[3] && (!l || !memcmp(ep->emm + 4, rdr->hexserial, l)));
     324
    325325        default:
    326326            ep->type = UNKNOWN;
     
    336336    memset(filter, 0x00, 32);
    337337
     338    int base = rdr->hexserial[3];
     339    int emm_g = base * 8;
     340    int emm_s = emm_g + 2;
     341    int emm_u = emm_g + 3;
     342
    338343    switch (type) {
    339344        case GLOBAL:
     345            // hex addressed
    340346            filter[0]    = 0x82;
    341347            filter[0+16] = 0xFF;
    342             filter[1]    = 0x00;
    343             filter[1+16] = 0x2F; // 0x00 to 0xD0
     348            filter[1]    = emm_g;
     349            // FIXME: more restrictive filter for provider addressed EMM's
     350            filter[1+16] = 0x0F;
    344351            break;
     352
    345353        case SHARED:
    346354            filter[0]    = 0x82;
    347355            filter[0+16] = 0xFF;
    348             filter[1]    = 0xD2;
    349             filter[1+16] = 0x0F;
     356            filter[1]    = emm_s;
     357            filter[1+16] = 0xFF;
    350358            memcpy(filter+2, rdr->hexserial, 2);
    351359            memset(filter+2+16, 0xFF, 2);
    352360            break;
     361
    353362        case UNIQUE:
    354363            filter[0]    = 0x82;
    355364            filter[0+16] = 0xFF;
    356             filter[1]    = 0xD3;
    357             filter[1+16] = 0x0F;
     365            filter[1]    = emm_u;
     366            filter[1+16] = 0xFF;
    358367            memcpy(filter+2, rdr->hexserial, 4);
    359368            memset(filter+2+16, 0xFF, 4);
Note: See TracChangeset for help on using the changeset viewer.