Start Chipkarten Kommandos
06 | 02 | 2012
Kommandos

Einleitung

COS = ChipcardOperatingSystem (OverView)

Die Chipkarten / Smartcards verfügen alle über ein Betriebssystem, dass für die Kommunikation unbedingt notwendig ist. (vgl. DOS bei PC's) Auf die Grundlagen sind wir schon auf der Chipkarteneinführung bzw. der Chipkartetechnik eingegangen. Hier findest Du die Grund/Basiskommandos einer Chipkarte. Die Karten haben i.d.R. darüber hinaus noch mehr Funktionen, die dann aber speziell für die Anwendung gedacht sind.

COS-Kurzübersicht

Die hier gezeigten Befehle haben wir u.a. von der Telesec Homepage entnommen und die Kommando- bzw. Parameterstruktur über die BeispielProtokolle bzw. aus den InternetQuellen zugeordnet.

Abkürzungen:

ATR Answer to reset
CHV Card Holder Verification - PIN/Passphrase
DF Dedicated file
EF Elementary file
MF Master file (also EF)
FCI File control information

Aufbau einer CAPDU (CommandApplicationProtocolDataUnit):

CAPDU CLA INS P1 P2 Lc Data Le
Bezeichnung ClassByte InstructionByte Parameter1 Parameter2 Legnth of Command DataField Length of expected data
Bedeutung Kommando - Klasse Kommando - Prozedur Befehls - Optionen Befehls - Optionen Länge des Datnfelds Daten max. Länge der Antwortdaten

Aufbau einer RAPDU (ResponseApplicationProtocolDataUnit):

RAPDU Data SW1 SW2
Bezeichnung DataField Statusbyte1 Statusbyte2
Bedeutung Antwortdaten des Kommandos Byte1 des Statusworts Byte2 des Statusworts

Das Format jeder ICCAnweisung und Antwort muss sich an obiger Tabelle orientieren!

COS-Kommando INS/InstructionByte Bedeutung
select 0xA4 Öffnen einer Applikation und/oder Datei
read binary 0xB0 Daten aus der Chipkarte auslesen
update binary 0xD6 Daten in die Chipkarte schreiben
read record 0xB2 Daten in Form von Records lesen
update record 0xDC Daten in Form von Records schreiben
create file 0xE0 Datei auf der Chipkarte anlegen
delete file 0xE4 Datei auf der Chipkarte löschen
verify 0x20 PIN oder Password prüfen
change pin 0x24 PIN oder Password ändern
unblock pin 0x2C Fehlbedienungszähler (FBZ) mit PUK zurücksetzen
null pin - -
internal authentication (ICC gegenüber Host) 0x88 Authentisierung der ICC gegenüber dem Host
ask random (Karte liefert Zufallszahl) 0x84 Zufallszahl von der ICC anfordern
external authentication (Host gegenüber ICC) 0x82 Authentisierung des Host gegenüber der ICC
close application 0xAC Schließen einer Applikation und/oder Datei
get session key 0x52 DES oder DES3-SessionKey lesen
signature (Digitale Signatur) 0x54 Daten mit der ICC signieren/verschlüsseln
crypt (Symmetrische und asymmetrische Verschlüsselung) 0x56 Daten mit der ICC verschlüsseln
get response 0xC0 -
set key (Schlüsselauswahl) 0xA8 TransferSchlüssel definieren
     
erase binary 0x0E -
manage channel 0x70 -
envelope 0xC2 -
get data 0xCA -
put data 0xDA -
append record 0xE2 -

Darüberhinaus existieren weitere COS-Kommandos, die stellenweise absichtlich vom Hersteller nicht dokumentiert sind. Diese nicht dokumentierten Kommandos betreffen häufig die Sicherheitsfunktionen der Chipkarte. Jedoch kann jeder Interessierte diese Kommandos im gewissen Rahmen mit der Methode "Try and Error!" herausfiltern. Dafür benötigt Ihr nur ein paar Tage Zeit.

Liste der möglichen Statusbytes SW1 / SW2:

Code Bedeutung
90 00 No further qualification - command successful - Bei asyncronen Karten
90 01 command successful - Bei syncronen Karten
61 xx SW2 indicates the number of response bytes still available. Use GET RESPONSE to access this data.
62 xx Warning - state unchanged
62 00 Warning - no information provided
62 81 Warning - part of returned data may be corrupt
62 82 Warning - end of file/record reached (bad cmd)
62 83 Warning - selected file invalidated
62 84 Warning - bad file control information format
63 xx Warning - state unchanged
63 00 Warning - no information provided
63 81 Warning - file filled up with last write
63 Cx Warning - counter value is x
64 xx Error - state unchanged
65 xx Error - state changed
65 00 Error - no information provided
65 81 Error - memory failure
66 xx Security Error
67 00 Check Error - wrong length
68 xx Check Error - CLA function not supported
68 00 Check Error - no information provided
68 81 Check Error - logical channel not supported
68 82 Check Error - secure messaging not supported
69 xx Check Error - command not allowed
69 00 Check Error - no information provided
69 81 Check Error - command incompatible with file structure
69 82 Check Error - security status not satisfied
69 83 Check Error - authentication method blocked
69 84 Check Error - referenced data invalidated
69 85 Check Error - conditions of use not satisfied
69 86 Check Error - command not allowed (no current EF)
69 87 Check Error - expected SM data objects missing
69 88 Check Error - SM data objects incorrect
6A xx Check Error - wrong parameters
6A 00 Check Error - no information provided
6A 80 Check Error - incorrect parameters in data field
6A 81 Check Error - function not supported
6A 82 Check Error - file not found
6A 83 Check Error - record not found
6A 84 Check Error - not enough memory space in the file
6A 85 Check Error - Lc inconsistant with TLV structure
6A 86 Check Error - inconsistant parameters P1-P2
6A 87 Check Error - Lc inconsistant with P1-P2
6A 88 Check Error - referenced data not found
6B 00 Check Error - wrong parameters
6C xx Check Error - wrong length - xx is the correct length
6D 00 Check Error - instruction code not supported or invalid
6E 00 Check Error - Class not supported
6F 00 Check Error - no precise diagnosis
 
Schlagzeilen

Unsere neu gestaltete Homepage ist Joomla-basiert! Wir freuen uns schon auf Eure tatkräftige Mithilfe zu unseren Themen Sicherheit und Software. Einen Beitrag einreichen...

Werbung
Conrad Electronic