FreeRDP
smartcard-interpreter Namespace Reference

Data Structures

class  ApplicationDummy
 
class  ApplicationPIV
 
class  ApplicationGids
 

Functions

def createAppByAid (aid)
 

Variables

dictionary CMD_NAMES
 
dictionary AIDs
 
dictionary FIDs
 
dictionary DOs
 
dictionary ERROR_CODES
 
dictionary PIV_OIDs
 
 fin = open(sys.argv[1], "r")
 
int lineno = 0
 
int lastCmd = 0
 
 lastSelect = None
 
bool lastSelectFCI = False
 
 lastGetItem = None
 
 currentApp = None
 
string body = ''
 
string recvKey = 'pbRecvBuffer: { '
 
 pos = l.find(recvKey)
 
bool toCard = False
 
 pos2 = l.find(' }', pos)
 
string sendKey = 'pbSendBuffer: { '
 
 bytes = codecs.decode(body, 'hex')
 
 cla
 
 ins
 
 p1
 
 p2
 
dictionary cmdName = CMD_NAMES.get(ins, "<COMMAND 0x%x>" % ins)
 
 lc = bytes[4]
 
int i = 5
 
 aid = bytes[i:i+lc].hex()
 
string lastSelectT = "FCI"
 
dictionary P2_DATA_QUALIFIER
 
string pin = ''
 
int fileId = p1 * 256 + p2
 
 ret = currentApp.getData(fileId, bytes)
 
int status = bytes[-1] + bytes[-2] * 256
 

Function Documentation

◆ createAppByAid()

def smartcard-interpreter.createAppByAid (   aid)

Variable Documentation

◆ aid

smartcard-interpreter.aid = bytes[i:i+lc].hex()

◆ AIDs

dictionary smartcard-interpreter.AIDs
Initial value:
1 = {
2  "a00000039742544659": "MsGidsAID",
3  "a000000308": "PIV",
4  "a0000003974349445f0100": "SC PNP",
5 }

◆ body

smartcard-interpreter.body = ''

◆ bytes

smartcard-interpreter.bytes = codecs.decode(body, 'hex')

◆ cla

smartcard-interpreter.cla

◆ CMD_NAMES

dictionary smartcard-interpreter.CMD_NAMES

◆ cmdName

dictionary smartcard-interpreter.cmdName = CMD_NAMES.get(ins, "<COMMAND 0x%x>" % ins)

◆ currentApp

def smartcard-interpreter.currentApp = None

◆ DOs

dictionary smartcard-interpreter.DOs
Initial value:
1 = {
2  "df1f": "DO_FILESYSTEMTABLE",
3  "df20": "DO_CARDID",
4  "df21": "DO_CARDAPPS",
5  "df22": "DO_CARDCF",
6  "df23": "DO_CMAPFILE",
7  "df24": "DO_KXC00",
8 }

◆ ERROR_CODES

dictionary smartcard-interpreter.ERROR_CODES
Initial value:
1 = {
2  0x9000: "success",
3  0x6282: "end of file or record",
4  0x63C0: "warning counter 0",
5  0x63C1: "warning counter 1",
6  0x63C2: "warning counter 2",
7  0x63C3: "warning counter 3",
8  0x63C4: "warning counter 4",
9  0x63C5: "warning counter 5",
10  0x63C6: "warning counter 6",
11  0x63C7: "warning counter 7",
12  0x63C8: "warning counter 8",
13  0x63C9: "warning counter 9",
14  0x6982: "security status not satisfied",
15  0x6985: "condition of use not satisfied",
16  0x6A80: "incorrect parameter cmd data field",
17  0x6A81: "function not suppported",
18  0x6A82: "file or application not found",
19  0x6A83: "record not found",
20  0x6A88: "REFERENCE DATA NOT FOUND",
21  0x6D00: "unsupported",
22 }

◆ FIDs

dictionary smartcard-interpreter.FIDs
Initial value:
1 = {
2  0x0000: "Current EF",
3  0x2F00: "EF.DIR",
4  0x2F01: "EF.ATR",
5  0x3FFF: "Current application(ADF)",
6 }

◆ fileId

int smartcard-interpreter.fileId = p1 * 256 + p2

◆ fin

smartcard-interpreter.fin = open(sys.argv[1], "r")

◆ i

int smartcard-interpreter.i = 5

◆ ins

smartcard-interpreter.ins

◆ lastCmd

dictionary smartcard-interpreter.lastCmd = 0

◆ lastGetItem

smartcard-interpreter.lastGetItem = None

◆ lastSelect

dictionary smartcard-interpreter.lastSelect = None

◆ lastSelectFCI

bool smartcard-interpreter.lastSelectFCI = False

◆ lastSelectT

string smartcard-interpreter.lastSelectT = "FCI"

◆ lc

smartcard-interpreter.lc = bytes[4]

◆ lineno

int smartcard-interpreter.lineno = 0

◆ p1

smartcard-interpreter.p1

◆ p2

smartcard-interpreter.p2

◆ P2_DATA_QUALIFIER

dictionary smartcard-interpreter.P2_DATA_QUALIFIER
Initial value:
1 = {
2  0x00: "Card global password",
3  0x01: "RFU",
4  0x80: "Application password",
5  0x81: "Application resetting password",
6  0x82: "Application security status resetting code",
7  }

◆ pin

string smartcard-interpreter.pin = ''

◆ PIV_OIDs

dictionary smartcard-interpreter.PIV_OIDs
Initial value:
1 = {
2  "5fc101": "X.509 Certificate for Card Authentication",
3  "5fc102": "Card Holder Unique Identifier",
4  "5fc103": "Cardholder Fingerprints",
5  "5fc105": "X.509 Certificate for PIV Authentication",
6  "5fc106": "Security Object",
7  "5fc107": "Card Capability Container",
8  "5fc108": "Cardholder Facial Image",
9  "5fc10a": "X.509 Certificate for Digital Signature",
10  "5fc10b": "X.509 Certificate for Key Management",
11  "5fc10d": "Retired X.509 Certificate for Key Management 1",
12  "5fc10e": "Retired X.509 Certificate for Key Management 2",
13  "5fc10f": "Retired X.509 Certificate for Key Management 3",
14 }

◆ pos

smartcard-interpreter.pos = l.find(recvKey)

◆ pos2

smartcard-interpreter.pos2 = l.find(' }', pos)

◆ recvKey

string smartcard-interpreter.recvKey = 'pbRecvBuffer: { '

◆ ret

string smartcard-interpreter.ret = currentApp.getData(fileId, bytes)

◆ sendKey

string smartcard-interpreter.sendKey = 'pbSendBuffer: { '

◆ status

int smartcard-interpreter.status = bytes[-1] + bytes[-2] * 256

◆ toCard

bool smartcard-interpreter.toCard = False