Fix SFI handling

git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@159 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
hploetz 2007-01-13 02:24:24 +00:00
parent 83ba3a1d73
commit 2eac1f6b44
3 changed files with 22 additions and 3 deletions

View File

@ -220,6 +220,10 @@ def decode_lcs(value):
)
)
def decode_sfi(value):
if len(value) == 0: return ""
return " 0x%02x" % (ord(value[0]) >> 3)
tags = {
None: {
0x01: (lambda a: (len(a) > 0 and ord(a[0]) != 0) and " True" or " False", "Boolean"),
@ -251,7 +255,7 @@ tags = {
0x85: (binary, "Proprietary information"),
0x86: (binary, "Security attributes"),
0x87: (binary, "Identifier of an EF containing an extension of the FCI"),
0x88: (binary, "Short EF identifier"),
0x88: (decode_sfi, "Short EF identifier"),
0x8A: (decode_lcs, "Life cycle status byte"),
0xA5: (recurse, "Proprietary information", None),

View File

@ -1,3 +1,4 @@
import utils
from iso_7816_4_card import *
class SECCOS_Card(ISO_7816_4_Card):
@ -14,3 +15,13 @@ class SECCOS_Card(ISO_7816_4_Card):
("3BFF1800FF8131FE45656311086602800011........0620..", None),
("3BFF9600FF8131FE4565631901500280000F........5012..", None),
]
def decode_sfi_path(value):
return " SFI: 0x%02x, path: %s" % (ord(value[0]) >> 3, utils.hexdump(value[1:], short=True))
TLV_OBJECTS = {
TLV_utils.context_FMD: {
0x85: (decode_sfi_path, "SFI with path"),
},
}
TLV_OBJECTS[TLV_utils.context_FCI] = TLV_OBJECTS[TLV_utils.context_FMD]

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-3.7.dtd">
<!-- Project file for project cyberflex-shell -->
<!-- Saved: 2006-11-22, 07:24:14 -->
<!-- Copyright (C) 2006 Henryk Plötz, henryk@ploetzli.ch -->
<!-- Saved: 2007-01-12, 12:30:01 -->
<!-- Copyright (C) 2007 Henryk Plötz, henryk@ploetzli.ch -->
<Project version="3.7">
<ProgLanguage mixed="0">Python</ProgLanguage>
<UIType>Qt</UIType>
@ -80,6 +80,10 @@
<Dir>cards</Dir>
<Name>postcard_card.py</Name>
</Source>
<Source>
<Dir>cards</Dir>
<Name>seccos_card.py</Name>
</Source>
</Sources>
<Forms>
</Forms>