- Timestamp:
- 10/24/09 12:00:35 (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-camd35.c
r470 r473 188 188 mbuf[129]=(reader[au].b_nano[0xd2])?0:1; 189 189 mbuf[130]=(reader[au].b_nano[0xd3])?0:1;*/ 190 mbuf[128]=1; //we think client/server protocols should deliver all information, and only readers should discard EMM 191 mbuf[129]=1; 192 mbuf[130]=1; 190 //we think client/server protocols should deliver all information, and only readers should discard EMM 191 mbuf[128]=1; //if 0, GA EMM is blocked 192 mbuf[129]=1; //if 0, SA EMM is blocked 193 mbuf[130]=1; //if 0, UA EMM is blocked 193 194 } 194 195 else // disable emm -
trunk/reader-common.c
r467 r473 102 102 cs_ddump(cta_res, cta_lr, "answer from cardreader %s:", reader[ridx].label); 103 103 return rc; 104 } 105 106 #define CMD_LEN 5 107 108 int card_write(uchar *cmd, uchar *data) 109 { 110 if (data) { 111 uchar buf[256]; //only allocate buffer when its needed 112 memcpy(buf, cmd, CMD_LEN); 113 if (cmd[4]) memcpy(buf+CMD_LEN, data, cmd[4]); 114 return(reader_cmd2icc(buf, CMD_LEN+cmd[4])); 115 } 116 else 117 return(reader_cmd2icc(cmd, CMD_LEN)); 104 118 } 105 119 -
trunk/reader-conax.c
r470 r473 5 5 extern ushort cta_lr; 6 6 7 #define CMD_LEN 58 7 /* 9 8 static unsigned int Conax_ToDate(char data0, char data1) … … 29 28 } 30 29 31 32 static int card_write(uchar *cmd, uchar *data, int wflag)33 {34 int l;35 uchar buf[MAX_LEN];36 memcpy(buf, cmd, CMD_LEN);37 l=wflag ? cmd[4] : 0;38 if (l && data) memcpy(buf+CMD_LEN, data, l);39 l=reader_cmd2icc(buf, CMD_LEN+l);40 return(l);41 }42 43 30 #define write_cmd(cmd, data) \ 44 31 { \ 45 if (card_write(cmd, data , 1)) return(0); \32 if (card_write(cmd, data)) return(0); \ 46 33 } 47 34 48 35 #define read_cmd(cmd, data) \ 49 36 { \ 50 if (card_write(cmd, data, 0)) return(0); \37 if (card_write(cmd, NULL)) return(0); \ 51 38 } 52 39 -
trunk/reader-cryptoworks.c
r470 r473 100 100 } 101 101 102 static int card_write(uchar *cmd, uchar *data, int wflag)103 {104 int l;105 uchar buf[MAX_LEN];106 memcpy(buf, cmd, CMD_LEN);107 l=wflag ? cmd[4] : 0;108 if (l && data)109 memcpy(buf+CMD_LEN, data, l);110 l=reader_cmd2icc(buf, CMD_LEN+l);111 return(l);112 }113 114 102 #define write_cmd(cmd, data) \ 115 103 { \ 116 if (card_write(cmd, data , 1)) return(0); \104 if (card_write(cmd, data)) return(0); \ 117 105 } 118 106 119 107 #define read_cmd(cmd, data) \ 120 108 { \ 121 if (card_write(cmd, data, 0)) return(0); \109 if (card_write(cmd, NULL)) return(0); \ 122 110 } 123 111 -
trunk/reader-nds.c
r470 r473 128 128 static unsigned char d3BEKey[0x10]; 129 129 130 ///====================================================================================================131 /*132 static int card_write(uchar *cmd, const uchar *data, int wflag)133 {134 int l;135 uchar buf[MAX_LEN];136 memcpy(buf, cmd, CMD_LEN);137 l=wflag ? cmd[4] : 0;138 if (l && data) memcpy(buf+CMD_LEN, data, l);139 //cs_log("EMM: %s",cs_hexdump(1,buf,CMD_LEN+l));140 l=reader_cmd2icc(buf, CMD_LEN+l);141 return(l);142 }143 144 #define write_cmd(cmd, data) \145 { \146 if (card_write(cmd, data, 1)) return(0); \147 }148 149 #define read_cmd(cmd) \150 { \151 if (card_write(cmd, NULL, 0)) return(0); \152 }153 */154 //==============================================================155 156 130 static AES_KEY aeskey; 157 131 -
trunk/reader-seca.c
r470 r473 15 15 char *card; 16 16 17 #define CMD_LEN 518 19 static int card_write(uchar *cmd, uchar *data, int wflag)20 {21 int l;22 uchar buf[256];23 memcpy(buf, cmd, CMD_LEN);24 l=wflag ? cmd[4] : 0;25 if (l && data) memcpy(buf+CMD_LEN, data, l);26 l=reader_cmd2icc(buf, CMD_LEN+l);27 return(l);28 }29 30 17 #define write_cmd(cmd, data) \ 31 18 { \ 32 if (card_write(cmd, data , 1)) return(0); \19 if (card_write(cmd, data)) return(0); \ 33 20 } 34 21 35 22 #define read_cmd(cmd, data) \ 36 23 { \ 37 if (card_write(cmd, data, 0)) return(0); \24 if (card_write(cmd, NULL)) return(0); \ 38 25 } 39 26 -
trunk/reader-viaccess.c
r467 r473 4 4 extern uchar cta_cmd[], cta_res[]; 5 5 extern ushort cta_lr; 6 7 #define CMD_LEN 58 6 9 7 struct geo_cache … … 142 140 } 143 141 144 static int card_write(const uchar *cmd, const uchar *data, int wflag)145 {146 int l;147 uchar buf[256];148 memcpy(buf, cmd, CMD_LEN);149 l=wflag ? cmd[4] : 0;150 if (l && data) memcpy(buf+CMD_LEN, data, l);151 l=reader_cmd2icc(buf, CMD_LEN+l);152 return(l);153 }154 155 142 #define write_cmd(cmd, data) \ 156 143 { \ 157 if (card_write(cmd, data , 1)) return(0); \144 if (card_write(cmd, data)) return(0); \ 158 145 } 159 146 160 147 #define read_cmd(cmd, data) \ 161 148 { \ 162 if (card_write(cmd, data, 0)) return(0); \149 if (card_write(cmd, NULL)) return(0); \ 163 150 } 164 151 … … 537 524 ///cs_log("update error: %02X %02X", cta_res[cta_lr-2], cta_res[cta_lr-1]); 538 525 539 read_cmd(insc8, insc8Data); 526 //read_cmd(insc8, insc8Data); this cannot be right, insc8Data would be ignored -- dingo35 527 write_cmd(insc8, insc8Data); 540 528 if( cta_res[0] != 0x00 || cta_res[1] != 00 || cta_res[cta_lr-2]!=0x90 || cta_res[cta_lr-1]!=0x00 ) { 541 529 ///cs_dump(cta_res, cta_lr, "extended status error:"); -
trunk/reader-videoguard2.c
r469 r473 355 355 } 356 356 357 #define CMD_LEN 5358 359 357 static int status_ok(const unsigned char *status){ 360 358 //cs_log("check status %02x%02x", status[0],status[1]); … … 366 364 } 367 365 368 static int card_write(const uchar *cmd, const uchar *data, int wflag) 369 { 370 int l; 371 uchar buf[256]; 372 memcpy(buf, cmd, CMD_LEN); 373 l=wflag ? cmd[4] : 0; 374 if (l && data) memcpy(buf+CMD_LEN, data, l); 375 l=reader_cmd2icc(buf, CMD_LEN+l); 376 return(l); 377 } 378 379 #define write_cmd(cmd, data) (card_write(cmd, data, 1) == 0) 380 #define read_cmd(cmd, data) (card_write(cmd, data, 0) == 0) 366 #define write_cmd(cmd, data) (card_write(cmd, data) == 0) 367 #define read_cmd(cmd, data) (card_write(cmd, NULL) == 0) 381 368 382 369 static int read_cmd_len(const unsigned char *cmd)
Note:
See TracChangeset
for help on using the changeset viewer.