[Muscle] Whether different card manufacturers have different commands format ?

2009-01-19 Thread lion
Hi, All
 After days work, I am still chaos of conception about smartcards.

 I introduce my environment first.
 We designed ourself's smardcard controller and use the TDA8024 
inerface chip. 
 It's looks like:

 (Our STB)

|  |
|  cpu - smard controller - TDA8024   |
|___| 

We bought several Nagravision Cards on line. But have not any documents neither 
the seller have.

And I am the people who must write the lowest driver.
I have read out the ATR about the card:
3f ff 95 00 ff 91 81 71 a0 47 00 44 4e 41 53 50 30 20 54 65 73 74 30 33

Then, I tried to send SELECT FILE command as the ISO7816-4 defined to the 
card.But have none reponse.

So, I searched in google and found out a nagravision hack faq.pdf  where said 
nagravision's cards 
send commands in format 
A0 CA 00 00 CL CN DL data0 ..dataDL-1 RL .
And that's different with ISO7816-4 ( CLA INS P1 P2  Lc DATA Le ).

But my boss gave me a pdf   TS 102 221, UICC-Terminal interface; Physical and 
logical characteristics.,
He said all smartcards used in DVB should follow this standard.(This standard 
defines commands format different from nagravision hack faq.pdf but the same 
as the ISO7816-4 ).

So , I want to know whether different card manufacturers have different 
commands format ? 
eg. nagravision have command format A0 CA 00 00 CL CN DL data0 .. dataDL-1 
RL.

And, if so. 
Whether manufacturers produce cards for DVB systems use the commands format 
defined by themself,
or following SmartCard UICC-Terminal interface(who's command format more likely 
the ISO7816-4) standard ? 

Thank you for your time !

Cheers,
Bob
___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re:Re: [Muscle] How can I know what's the type of a card through it's ATR?

2009-01-14 Thread lion
 http://www.nagravision.com/
 It should be a pay-tv card. One of the more secret cards.

 I don't think you can do anything with this card (except watch TV). In
 general, the game is to create faked pay-tv cards not try to use a
 real one.

Yes, that's right. It's used in our set-top box(STB). 
I just try to do some base firmware tests now. And may be added supports under 
OpenCT later.

I changed a card and readed out the ATR:
TS: 3f  T0: ff  TA1:95  TB1:00  TC1: ff TD1: 91 TA2: 81 TD2:71  TA3:a0  TB3:47  
TC3:00
History: 44 4e   415350   30   20   54   65   73   74   30   33

So, It should be a nagravision card , and there may be  some unknow problems in 
the former card i used.

But I got a new problem.
The TD1 in the ATR is 0x91, so only protocol T=1 is supported.  
And TA1 is 0x95,  that means Fi=9, Di=5,not Fd=Dd=1 any more.
And TA2 is 0x81,  means that it's Specific mode.and it's bit5=0.

Then whether I needed sending PTS to select protocol T=1 after receiving ATR ?
If needed, how to send it ?
Because   ISO7816 3.4 Protocol type selection (PTS)   said  If only one 
protocol type and FI=D=1 (default value of TA1) and N smaller than 255 is 
indicated in the answer to reset. The transmission protocol associated to the 
protocol type may be started immediately after the transmission of answer to 
reset. 
So, I can't send PTS because Fi=9 and Di=5, and N=0xff.

If not, the following operations such as SELECT FILE use which F and D(Fi, Di 
or Fd, Dd) ? 

I did'not found clear answers in ISO7916-3 about these things. May be I shoule 
read it once more.

 Oh, if you want *my* advice - I would get into pig farming rather than 
 smartcard programming,
 it's a lot more rewarding and you can bring home the bacon at the end of the 
 day ;-)

A ha, You have a good sense of humor. But sometimes it's no choice. 


It's so long, thank you for your time.
---
Best Regards,
Bob___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re:Re: [Muscle] How can I know what's the type of a card through it's ATR?

2009-01-13 Thread lion
Thanks again for your informations.
I have a last thing want to be confirmed that  the commands defined in 
ISO7816-4 are not a standard?
All commands are card dependent ? (Although sometimes different types may have 
the same commands set).

I am looking the OPENCT sourece, 
Thanks again!
-
bob


If you don't know what type of card you have, then just sending random APDUs to 
the
card won't do you much good, and you may wind up locking up the card and 
rendering
it useless.


In your example, you are looking at a Gemalto forum, do you think that your 
card is a
Gemalto card of some type?


 You can try some common APDUs that work with OpenPlatform JavaCard  
So, I don't know here what commands I can use ? 


Do a Google search for OpenPlatform or have a look at the OpenSC sources for
example to find more information on APDUs that you can use.


And in my opinion, most of the commands in ISO7816-4 should SELECT FILE at 
first.
So, I  just try to implement the SELECT FILE command.


Well, why do you think that you need to do a SELECT FILE at first? Some cards 
don't
have any type of filesystem at all, so a SELECT FILE won't do anything with 
those types
of cards.

mike



___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re:Re:Re: [Muscle] How can I know what's the type of a card through it's ATR?

2009-01-13 Thread lion
ha, I got a little more information.

There are characters NAGRAVISION on one side of the cards. 
And there wroted Swiss Mode. But I still have no clear idea about it.

---
Bob
___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


[Muscle] How can I know what's the type of a card through it's ATR?

2009-01-12 Thread lion
Hi, All
I am wirting a smartcard driver, the ATR is like below. 
ATR:   TS is 3b
 T0  is 6c
 TB1 is 0
TC1 is 2
history char is : 36 61 86 38 4b 8c 13 4 62 3 59 8a 

 Then,how can I know what's the type of my card(such as the producer..)

I have try to find it at http://www.sun-rays.org/lib/smartcard_list.txt,but 
have no answer.

I want to do this, because i always get failure when selecting the MF file.
I try to get more information about my card.

Thanks a lot
Bob___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re:Re: [Muscle] How can I know what's the type of a card through it's ATR?

2009-01-12 Thread lion
Thanks a lot for your detail information. 

I want to find out  informations on the card just in order to find out the 
command set of the card.

I don't know the commands is ISO7816 based or card producer dependent ?

eg. I find out the SELECT FILE command from ISO7816(MF file):  00 A4  02 
3F00
  But the response error. So, I looked up in Google,and someone says the 
command 
  may be this: A0 A4  02 3F00 , depending on the card's type.
(http://developer.gemalto.com/nc/forums.html?view=single_threadcat_uid=1conf_uid=3thread_uid=445page=3)

 You can try some common APDUs that work with OpenPlatform JavaCard  
So, I don't know here what commands I can use ?  
And in my opinion, most of the commands in ISO7816-4 should SELECT FILE at 
first.
So, I  just try to implement the SELECT FILE command.

--
Cherrs,
Bob


On Jan 12, 2009, at 12:43 AM, lion wrote:

 Hi, All
 I am wirting a smartcard driver, the ATR is like below.
 ATR:   TS is 3b
  T0  is 6c
  TB1 is 0
 TC1 is 2
 history char is : 36 61 86 38 4b 8c 13 4 62 3 59 8a

  Then,how can I know what's the type of my card(such as the  
 producer..)

 I have try to find it at http://www.sun-rays.org/lib/smartcard_list.txt,but 
  have no answer.

 I want to do this, because i always get failure when selecting the  
 MF file
 I try to get more information about my card.

Well my experience is that you can't always tell what type of card you  
have just
by looking at the ATR, which is why I created the SwapDrop language  
that Sun Ray
uses to run smartcard config files that use heuristics to identify a  
card that is
inserted into the Sun Ray's internal smartcard reader. The config  
files may use
the ATR information (usually the history bytes and/or the length) as  
one of the tests
to try to identify a card. Other tests include checking for the  
presence of specific
directories and/or files, checking for the length and/or contents of a  
particular file,
trying to select one or more applets (on cards that support applets)  
and issuing
specific APDUs and noting the response from the card.

I had a look on Ludovic's list here:

http://ludovic.rousseau.free.fr/softwares/pcsc-tools/smartcard_list.txt

but I couldn't find an ATR that matches your card's ATR.

Try playing with Google to see if someone else has posted the ATR or  
an ATR
that is similar to yours.

Do you have any more information on the card that you want to find out  
about?
You can try some common APDUs that work with OpenPlatform JavaCard  
cards,
perhaps you have one of those cards. Or maybe scan an image of the  
card (if
it's not a blank white card ;-) and post it somewhere for people to  
look at. Even if
it is a blank white card, you can usually tell the manufacturer of the  
chip from the
contact pad design, so that might be a good lead.

mike
___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle