pySim-read.py: Enable reading of Home Network Domain Name from ISIM

As per TS1.103 version 14.2.0, this EF contains the home operator's network domain name.
The Home Network Domain Name, i.e. FQDN shall be encoded to an octet string
according to UTF-8 encoding rules as specified in IETF RFC 3629

Change-Id: Ia3c68c717d105e10d52a8e9d170480da2ad7d65a
This commit is contained in:
Supreeth Herle
2020-03-25 10:23:48 +01:00
committed by herlesupreeth
parent cf727f2733
commit 05b2807168
3 changed files with 22 additions and 0 deletions

View File

@@ -336,6 +336,16 @@ class IsimCard(Card):
data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, rpad(content, rec_size_bytes*2))
return sw
def read_domain(self):
(res, sw) = self._scc.read_binary(EF_ISIM_ADF_map['DOMAIN'])
if sw == '9000':
# Skip the inital tag value ('80') byte and get length of contents
length = int(res[2:4], 16)
content = h2s(res[4:4+(length*2)])
return (content, sw)
else:
return (None, sw)
class _MagicSimBase(Card):
"""