- Timestamp:
- 01/05/10 18:33:18 (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-newcamd.c
r1045 r1076 851 851 mbuf[12] = reader[au].hexserial[3]; 852 852 mbuf[13] = reader[au].hexserial[4]; 853 }854 else if ((pufilt->caid >> 8) == 0x18)855 {856 mbuf[8] = 0x00;857 mbuf[9] = 0x00;858 mbuf[10] = reader[au].hexserial[0];859 mbuf[11] = reader[au].hexserial[1];860 mbuf[12] = reader[au].hexserial[2];861 mbuf[13] = reader[au].hexserial[3];862 853 } 863 854 else -
trunk/oscam-config.c
r1074 r1076 1132 1132 return; 1133 1133 } 1134 if (!strcmp(token, "n3_boxkey") || !strcmp(token, "tiger_ideakey")) 1134 if (!strcmp(token, "n3_boxkey")) 1135 { 1136 if (key_atob_l(value, rdr->nagra_boxkey, 16)) 1137 { 1138 fprintf(stderr, "Configuration reader: Error in Nagra Boxkey\n"); 1139 exit(1); 1140 } 1141 return; 1142 } 1143 if (!strcmp(token, "tiger_ideakey")) 1135 1144 { 1136 1145 if (key_atob_l(value, rdr->nagra_boxkey, 16)) -
trunk/reader-nagra.c
r1043 r1076 94 94 if(!reader_cmd2icc(msg,msglen)) 95 95 { 96 cs_sleepms( 20);96 cs_sleepms(15); 97 97 if(cta_res[0]!=res) 98 98 { … … 199 199 else 200 200 { 201 memcpy(camid,reader[ridx].hexserial ,4);201 memcpy(camid,reader[ridx].hexserial+2,4); 202 202 } 203 203 } … … 348 348 // first halve is IDEA Hashed in chuncs of 8 bytes using the Signature1 from dt08 calc, CamID-Inv.CamID(16 bytes key) the results are the First 8 bytes of the Session key 349 349 memcpy(idea1, signature, 8); 350 memcpy(idea1+8, reader[ridx].hexserial , 4);351 idea1[12] = ~reader[ridx].hexserial[ 0]; idea1[13] = ~reader[ridx].hexserial[1]; idea1[14] = ~reader[ridx].hexserial[2]; idea1[15] = ~reader[ridx].hexserial[3];350 memcpy(idea1+8, reader[ridx].hexserial+2, 4); 351 idea1[12] = ~reader[ridx].hexserial[2]; idea1[13] = ~reader[ridx].hexserial[3]; idea1[14] = ~reader[ridx].hexserial[4]; idea1[15] = ~reader[ridx].hexserial[5]; 352 352 353 353 Signature(sign1, idea1, tmp, 32); … … 560 560 reader[ridx].nprov = 1; 561 561 memset (reader[ridx].sa, 0xff, sizeof (reader[ridx].sa)); 562 memset(reader[ridx].hexserial, 0, 8); 562 563 reader[ridx].caid[0]=SYSTEM_NAGRA; 563 564 … … 573 574 cs_debug("[nagra-reader] detect nagra tiger card"); 574 575 memcpy(rom,atr+11,15); 575 memset(reader[ridx].hexserial, 0xff, 4); // take 0xff as cardserial?576 576 is_tiger=1; 577 577 } … … 599 599 return 0; 600 600 } 601 memcpy(reader[ridx].hexserial , cta_res+2, 4);601 memcpy(reader[ridx].hexserial+2, cta_res+2, 4); 602 602 cs_debug("[nagra-reader] SER: %s", cs_hexdump (1, reader[ridx].hexserial, 4)); 603 603 memcpy(reader[ridx].sa[0], cta_res+2, 4); … … 656 656 void nagra2_post_process(void) 657 657 { 658 CamStateRequest(); 659 cs_sleepms(10); 660 if RENEW_SESSIONKEY NegotiateSessionKey(); 661 if SENDDATETIME DateTimeCMD(); 658 if (!is_tiger) 659 { 660 CamStateRequest(); 661 cs_sleepms(10); 662 if RENEW_SESSIONKEY NegotiateSessionKey(); 663 if SENDDATETIME DateTimeCMD(); 664 } 662 665 } 663 666 … … 677 680 678 681 } 679 cs_sleepms(15);680 682 while(!CamStateRequest() && retry < 5) 681 683 { 684 cs_debug("[nagra-reader] CamStateRequest failed, try: %d", retry); 682 685 retry++; 683 686 cs_sleepms(15); 684 687 } 685 cs_sleepms( 10);688 cs_sleepms(5); 686 689 if (HAS_CW && do_cmd(0x1C,0x02,0x9C,0x36,NULL)) 687 690 { … … 703 706 else 704 707 { 705 if(!do_cmd(0xd3,er->ecm[4]+2,0x53,0x16, er->ecm+3+2)) 708 // ecm_data: 80 30 89 D3 87 54 11 10 DA A6 0F 4B 92 05 34 00 ... 709 //serial_data: A0 CA 00 00 8C D3 8A 00 00 00 00 00 10 DA A6 0F . 710 unsigned char ecm_trim[150]; 711 memset(ecm_trim, 0, 150); 712 memcpy(&ecm_trim[5], er->ecm+3+2+2, er->ecm[4]+2); 713 if(do_cmd(er->ecm[3],er->ecm[4]+5,0x53,0x16, ecm_trim)) 706 714 { 707 715 if(cta_res[2] == 0x01) 708 716 { 717 709 718 unsigned char v[8]; 710 719 memset(v,0,sizeof(v)); … … 718 727 } 719 728 } 720 721 729 return(0); 722 730 }
Note:
See TracChangeset
for help on using the changeset viewer.