Changeset 1389 for trunk/reader-cryptoworks.c
- Timestamp:
- 01/31/10 19:48:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-cryptoworks.c
r1381 r1389 4 4 static BIGNUM exp, ucpk; 5 5 6 extern uchar cta_ cmd[], cta_res[];6 extern uchar cta_res[]; 7 7 extern ushort cta_lr; 8 8 … … 100 100 #define write_cmd(cmd, data) \ 101 101 { \ 102 if (card_write(cmd, data)) return (0); \102 if (card_write(cmd, data)) return ERROR; \ 103 103 } 104 104 105 105 #define read_cmd(cmd, data) \ 106 106 { \ 107 if (card_write(cmd, NULL)) return (0); \107 if (card_write(cmd, NULL)) return ERROR; \ 108 108 } 109 109 … … 155 155 if((cta_res[0]==0x98)&&(cta_res[1]==0x04)) cs_ri_log("[cryptoworks]-bad pincode"); 156 156 157 return (1);157 return OK; 158 158 } 159 159 … … 161 161 } 162 162 163 int cryptoworks_disbale_pin(void)163 static int cryptoworks_disable_pin(void) 164 164 { 165 165 unsigned char insPIN[] = { 0xA4, 0x26, 0x00, 0x00, 0x04, 0x00,0x00,0x00,0x00 }; //disable PIN … … 172 172 cs_ri_log("[cryptoworks]-disable pincode to card"); 173 173 if((cta_res[0]==0x98)&&(cta_res[1]==0x04)) cs_ri_log("[cryptoworks]-bad pincode"); 174 return (1);175 } 176 177 return(0); 178 } 179 180 int cryptoworks_card_init(uchar *atr) 181 { 174 return ERROR; 175 } 176 return OK; 177 } 178 179 int cryptoworks_card_init(ATR newatr) 180 { 181 get_atr; 182 182 int i; 183 183 unsigned int mfid=0x3F20; … … 189 189 char *unknown="unknown", *pin=unknown, ptxt[CS_MAXPROV<<2]={0}; 190 190 191 if ((atr[6]!=0xC4) || (atr[9]!=0x8F) || (atr[10]!=0xF1)) return (0);191 if ((atr[6]!=0xC4) || (atr[9]!=0x8F) || (atr[10]!=0xF1)) return ERROR; 192 192 193 193 reader[ridx].caid[0]=0xD00; … … 277 277 cs_log("ready for requests"); 278 278 279 cryptoworks_dis bale_pin(); //by KrazyIvan279 cryptoworks_disable_pin(); //by KrazyIvan 280 280 281 return (1);281 return OK; 282 282 } 283 283 … … 426 426 { 427 427 cs_log("cryptoworks: valid UCPK needed for camcrypt!"); 428 return (0);428 return ERROR; 429 429 } 430 430 } … … 616 616 617 617 } 618 return (1);619 } 618 return OK; 619 }
Note:
See TracChangeset
for help on using the changeset viewer.