Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
There's actually no additional TLV structure inside the Tag 0x04.
Change-Id: Ic922355308747a888083c5b26765d272b6b20bd0
|
|
This commit introduces the capability to parse and encode
SimAlliance/TCA "Interoperable Profiles" and apply personalization
operations on them.
Change-Id: I71c252a214a634e1bd6f73472107efe2688ee6d2
|
|
This commit introduces
* the osmo-smdpp.py program implementing the main procedures and the
HTTP/REST based ES9+
* python modules for ES8+ and non-volatile RSP Session State storage
* the ASN.1 source files required to parse/encode RSP
* 3GPP test certificates from SGP.26
* an unsigned profile package (UPP) of a SAIP v2.3 TS48 test profile
As I couldn't get the 'Klein' tls support to work, the SM-DP+ code
currently does not support HTTPS/TLS but plan HTTP, so you either have
to modify your LPA to use HTTP instead of HTTPS, or put a TLS proxy in
front.
I have successfully installed an eSIM profile on a test eUICC that
contains certificate/key data within the test CI defined in GSMA SGP.26
Change-Id: I6232847432dc6920cd2bd08c84d7099c29ca1c11
|
|
Change-Id: I4a0acdad5c7478ee76f92c7610c0e2a5331dea46
|
|
Prior to this patch, the command would always raise exceptions.
Change-Id: I75a7840c3f4b68bfc164a43908b100dd6e41e575
|
|
Contrary to {enable,disable}_profile, the delete_profile does not use
the ProfileIdentifier TLV, but directly the Iccid / IsdpAid.
Change-Id: I43e298524048703264e16cbdd0b76d82ba976985
|
|
Change-Id: I39d26cdd5b85a61a06fd8c7a9d0a046e398819bd
|
|
This tool is a replacement for asn1c 'unber' program with a much more
useful/readable output:
* contains hexadecimal raw tag values
* contains hexdump of value, rather than HTML entities in pseudo-XML
Change-Id: I22c1a461ccba04c2c8caaab7ca29ea6ae76e2ea3
|
|
This is the protocol used for the ES8+ interface between SM-DP+ and the
eUICC in the GSMA eSIM system.
Change-Id: Ic461936f2e68e1e6f7faab33d06acf3063e261e7
|
|
The definitions are not used yet, as one would have to add that
dynamically based on which EF.DIR entries contain the 0x73 discretionary
template. As I don't have any cards implementing this so far, I'll skip
that part.
Change-Id: I532ff2c94021ab1b4520fe2b6988c8960319d208
|
|
Change-Id: I124064994eb695790e9a3aff40be8139b3a2f2cf
|
|
Change-Id: Ife06f54c2443f3e048bd36f706f309843703403a
|
|
In smart cards, files/records containing all-ff means they are simply
not used/initialized. Let's avoid raising exceptions when interpreting
0xff as length value and reading less bytes as value.
Change-Id: I09c3cb82063fc094eb047749996a6eceff757ea2
|
|
We cannot fully switch to construct for all of it easily due to
the priority value and the ordering/sorting by priority implemented
in the hand-coded version. But we can at least migrate the
encode/decode of the hnet_pubkey_list via construct.
Change-Id: I4ad5ea57bab37c2dc218e7752d538aa4cdc36ee3
|
|
Change-Id: I519c7792c7fbe18be63ddc77d211f0d034afcd1f
|
|
Change-Id: Iea6b176327881ff9414f4fe624e94811f9782927
|
|
Example:
pySIM-shell (00:MF/ADF.ISD)> get_data extended_card_resources_info
{
"extended_card_resources_info": [
{
"number_of_installed_app": 8
},
{
"free_non_volatile_memory": 354504
},
{
"free_volatile_memory": 10760
}
]
}
Change-Id: I129e43c377b62dae1b9a88a0a2dc9663ac2a97da
|
|
If we are reading a file to check if we can skip the write to conserve
writes, don't treat exceptions as fatal. The file may well have the
access mode in a way that permits us to UPDATE but not to READ. Simply
fall-back to unconditional UPDATE in this case.
Change-Id: I7bffdaa7596e63c8f0ab04a3cb3ebe12f137d3a8
|
|
this has the advantage of getting the encoder for free (so far we only
had the decoder). While at it, also add some tests data for the unit
tests.
Change-Id: Ifb8caf5cd96706d7fb6b452d6552b115c0828797
|
|
It's customary in the SIM card universe to right-pad data with ff bytes.
So far we only test decoders without such padding, which is unrealistic.
Let's also tests the decoders with extra 'ff' padding present.
For some files this doesn't make sense, so we add a _test_no_pad class
attribute that can be spcified to prevent this new "test with ff-padding"
from being executed for the test data of the class.
Change-Id: I7f5cbb4a6f91040fe9adef9da0a1f30f9f156dae
|
|
Change-Id: Ib84a0ae35262a19fce3e688afe8e1678a4c59eba
|
|
The existing code used to produce an empty output in situations where a
TLV_IE_Collection would be parsed from a single TLV only with some
additional trailing padding:
>>> from pySim.utils import h2b
>>> from pySim.ts_31_102 import EF_CSGT
>>> t = EF_CSGT.Csgt_TLV_Collection()
>>> t.from_tlv(h2b('8906810300666f6fff'))
[TextCsgType(foo)]
>>> t.to_dict()
[]
This was caused by an early return (actually returning the decoded
result) but *without updating self.children*.
Change-Id: I1c84ccf698c6ff7e7f14242f9aaf7d15ac2239f4
|
|
These files are mostly related to CSG (Closed Subscriber Group)
in the context of HomeNodeB (HNB), aka femtocells.
Change-Id: Ie57963381e928e2c1da408ad46549a780056242a
|
|
Now that we have support for the UCS-2 encoding as per TS 102 221 Annex A,
we can start to make use of it from various file constructs.
As some specs say "Either 7-bit GSM or UCS-2" we also introduce
a related automatic GsmOrUcs2Adapter and GsmOrUcs2String class.
Change-Id: I4eb8aea0a13260a143e2c60fca73c3c4312fd3b2
|
|
TS 102 221 Annex A defines three variants of encoding UCS-2 characters
into byte streams in files on UICC cards: One rather simplistic one, and
two variants for optimizing memory utilization on the card.
Let's impelement a construct "Ucs2Adapter" class for this.
Change-Id: Ic8bc8f71079faec1bf0e538dc0dfa21403869c6d
|
|
The human representation of a PLMN is usually MCC-MNC like 262-01
or 262-001. Let's add a PlmnAdapter for use within construct, so we
can properly decode that.
Change-Id: I96f276e6dcdb54a5a3d2bcde5ee6dbaf981ed789
|
|
We used __subclasses__(), but this only returns the immediate
subclasses and not all further/nested subclasses. Instead, we must
use the pySim.utils.all_subclasses() function to really get all of them.
The hack to use the method signature of the constructor to determine if
it's an intermediate class didn't work, as even GlobbalPlatformISDR
has a optional argument for non-default AIDs. So let's introduce an
explicit class attribute for that purpose.
Change-Id: I7fb1637f8f7a149b536c4d77dac92736c526aa6c
|
|
Change-Id: Iae30f18435c2b0a349bfd9240b9c7cca06674534
|
|
Change-Id: Ib7b73cb28abea98986a66264a0779263873d7fb2
|
|
The list contains tuples of (key_type, key_length). Let's fix that.
Change-Id: Icf367827d62ed67afa27ee3d0ba9d5cd5bc65c99
|
|
This adds some first test data for the new unitdata driven test cases
for the TLV encoder/decoder.
It also fixes a bug in the ts_102_221.FileDescriptor decoder for BER-TLV
structured files which was found and fixed while introducing the test
data.
Related: OS#6317
Change-Id: Ief156b7e466a772c78fb632b2fa00cba2eb1eba5
|
|
While we do have the _test_de_encode data driven tests for file
definitions, we don't yet have something similar for derived classes of
BER_TLV_IE. This means that TLVs used outside of the filesystem context
(for example, decoding the SELECT/STATUS response, but also eUICC and
other stuff) do not yet have test coverage.
This commit just adds the related test code, but no test data yet.
Related: OS#6317
Change-Id: Ied85f292bb57fde11dc188be84e3384dc3ff1601
|
|
the to_dict() method generates a {class_name: value} dictionary,
for both the nested and non-nested case. However, before this patch,
the from_dict() method expects a plain list of child IE dicts
in the nested case. This is illogical.
Let's make sure from_dict always expectes a {class_name: value} dict
for both nested and non-nested situations.
Change-Id: I07e4feb3800b420d8be7aae8911f828f1da9dab8
|
|
We recently introduced a pySim.utils.build_construct() wrapper around
the raw call of the construct.build() method. So far, this wrapper
was only used from pySim.tlv, but let's also use it from
pySim.filesystem.
Basically, whenever we use parse_construct(), we should use
build_construct() as the inverse operation.
Change-Id: Ibfd61cd87edc72882aa66d6ff17861a3e918affb
|
|
on some systems, the output would otherwise contain colored status
words, which in turn mean the test otuput no longer matches the expected
output.
Change-Id: Icb700f6e85a285748e00367a398975aa5e75dec5
|
|
The context is some opaque dictionary that can be used by the
constructs; let's allow the caller of parse_construct, from_bytes,
from_tlv to specify it.
Also, when decoding a TLV_IE_Collection, pass the decode results of
existing siblings via the construct.
Change-Id: I021016aaa09cddf9d36521c1a54b468ec49ff54d
|
|
Change-Id: I77c30921f2b8c002c9dda244656c348c96b41f06
|
|
Change-Id: Ib563a2204922d2013b5f7c5abde0773051e17938
|
|
The EF.CFIS definition is not identical to EF.ADN, so we cannot recycle
the EF.ADN class to decode EF.CFIS.
Change-Id: Idcab35cbe28332e3c8612bcb90226335b48ea973
|
|
There are some pretty intricate rules about how GSM and E-UTRAN are
encoded, let's make sure we fully support both as per 3GPP TS 31.102
Release 17. As part of this, switch to a sorted list of access technologies,
in order to have a defined order. This makes comparing in unit tests
much easier. However, it also means that we need to sort the set
when printing the list of AcT in pySim-read to generate deterministic
output.
Change-Id: I398ac2a2527bd11e9c652e49fa46d6ca8d334b88
|
|
Without this the diff between expected and actual output is truncated
and one instead reads the following output:
Diff is 844 characters long. Set self.maxDiff to None to see it.
We actually want to see the full diff to see what's not matching.
Change-Id: I6e89705061454191b6db1255de7fe549ad720800
|
|
Change-Id: I080f6e173fec40c27dd3ebbf252eaddf5a0e15ba
|
|
This driver description we add to the code is automatically added to the
respective user manual sections.
Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629
|
|
Let's avoid copy+pasting print statements everywhere. The instances
do already have a __str__ method for the purpose of printing their name in a
generic way.
Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844
|
|
Opening PC/SC readers by index/number is very error-prone as the order
is never deterministic in any system with multiple (hot-plugged, USB)
readers. Instead, let's offer the alternative of specifying a regular
expression to match the reader name (similar to remsim-bankd).
Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78
|
|
It's odd that the individual transport driver specifies their argparse
options but then the core transport part evaluates them individually.
This means we cannot add new options within a transport.
Let's pass the Namespace instance into the constructor of the
specific transport to improve this.
Change-Id: Ib977007dd605ec9a9c09a3d143d2c2308991a12c
|
|
In the previous commit we've stopped using those functions from modern
pySim-shell code. Hence, the only remaining user is the legacy tools,
so we can move the code to the legacy module.
Change-Id: I6f18ccb36fc33bc204c01f9ece135676510e67ec
|
|
We've recently introduced IPv{4,6}Adapter construct classes and can
switch to this instead of using the old imperative encoder/decoder
functions {enc,dec}_addr_tlv().
Aside from code cleanup, this also means we now support the IPv6 address
type in EF.PCSCF.
Change-Id: I4d01ccfe473a8a80fbee33fdcbd8a19b39da85ac
|
|
This can happen if there's a file with invalid encoding on the card,
such as a tag followed by all-ff. Let's gracefully ignore it and
return zero bytes as response.
Change-Id: Ic44557368a6034dbf4bb021ab23a57927c22def0
|