mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-26 07:18:33 +03:00
BER-TLV EF support (command, filesystem, shell)
This adds support for a new EF file type: BER-TLV files. They are different from transparent and linear fixed EFs in that they neither operate on a byte stream nor fixed-sized records, but on BER-TLV encoded objects. One can specify a tag value, and the card will return the entire TLV for that tag. As indicated in the spec, the magic tag value 0x5C (92) will return a list of tags existing in the file. Change-Id: Ibfcce757dcd477fd0d6857f64fbb4346d6d62e63
This commit is contained in:
@@ -113,10 +113,14 @@ def interpret_file_descriptor(in_hex):
|
||||
1: 'transparent',
|
||||
2: 'linear_fixed',
|
||||
6: 'cyclic',
|
||||
0x39: 'ber_tlv',
|
||||
}
|
||||
fdb = in_bin[0]
|
||||
ftype = (fdb >> 3) & 7
|
||||
fstruct = fdb & 7
|
||||
if fdb & 0xbf == 0x39:
|
||||
fstruct = 0x39
|
||||
else:
|
||||
fstruct = fdb & 7
|
||||
out['shareable'] = True if fdb & 0x40 else False
|
||||
out['file_type'] = ft_dict[ftype] if ftype in ft_dict else ftype
|
||||
out['structure'] = fs_dict[fstruct] if fstruct in fs_dict else fstruct
|
||||
|
||||
Reference in New Issue
Block a user