diff options
author | hploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b> | 2007-05-31 19:33:35 +0000 |
---|---|---|
committer | hploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b> | 2007-05-31 19:33:35 +0000 |
commit | 89f7828412634b9ee4e6870b79d07d9b1fe3431b (patch) | |
tree | 594f96ade70809e22411d1071de17eaabb7f4854 /fingerpass.py | |
parent | 59adb0586595be189f747575c76e795d0c840504 (diff) |
Another fingerprinting characteristic: SELECT APPLICATION with P2=0 and no Le leads to 6700 Wrong Length
(The LDS technical report Appendix 2 to Annex A only explicitly allows P2=0xc with no Le)
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@201 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'fingerpass.py')
-rwxr-xr-x | fingerpass.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fingerpass.py b/fingerpass.py index 4d093e0..dce8a83 100755 --- a/fingerpass.py +++ b/fingerpass.py @@ -137,11 +137,16 @@ def fingerprint_7816(card): return "".join( [UNIT_FORMAT % r for r in compressed] ) + ":".join( (len(exceptional) > 0 and [""] or []) + [binascii.b2a_hex(e) for e in exceptional] ) result = [] + postfix = "" test_icao = card.select_application(card.resolve_symbolic_aid("mrtd"), le=None) + if test_icao.sw == "\x67\x00": + postfix = ":6700" # SELECT APPLICATION with P2=0 and without Le returns 6700 Wrong Length + test_icao = card.select_application(card.resolve_symbolic_aid("mrtd"), le=None, P2=0x0c) + if not card.check_sw(test_icao.sw, card.PURPOSE_SUCCESS): - result.append("N") # Not an ICAO MRTD + result.append("N"+postfix) # Not an ICAO MRTD else: - result.append("P") # An ICAO MRTD + result.append("P"+postfix) # An ICAO MRTD bac = detect_bac(card) result.append(bac) # BAC status |