Skip to content
Success

Changes

Summary

  1. ts_102_222: Implement support for RESIZE FILE for an EF (details)
  2. docs/Makefile: don't forward shrink to sphinx (details)
  3. gitignore: add manuals related files (details)
  4. fix SimCardCommands.run_gsm(): always use CLA=0xa0 (details)
  5. SimCardCommands.run_gsm(): use send_apdu_checksw() (details)
  6. pySim-shell.py: add a command for RUN GSM ALGORITHM (details)
  7. pySim-shell: add cardinfo command (details)
  8. pySim-prog.py: fix SyntaxWarning: using is with a literal (details)
  9. filesystem: define more convenient codec for EF.ACC (details)
  10. setup.py: add missing pySim-trace.py' to scripts[] (details)
  11. ts_51_011: fix EF_ServiceTable: use self for static method (details)
  12. Add very basic profile for R-UIM (CDMA) cards (details)
  13. pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable) (details)
  14. pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (include_ipy) (details)
  15. pySim-shell: fix compatibility problem with cmd2 >= 2.3.0 (bg) (details)
  16. requirements.txt: allow cmd2 versions greater than 1.5 (details)
  17. setup: add missing pyyaml to setup.py and README.md (details)
  18. README.md: add missing pycryptodome to dependency list (details)
  19. Fix pylint errors (details)
  20. contrib/jenkins.sh: print pylint version before running it (details)
  21. setup.py: add missing packages for pySim-trace.py (details)
  22. ts_51_011: Add sst_service_[de]{activate,allocate} shell commands (details)
  23. ts_31_102: Extend from Rel16 to Rel17 (details)
  24. ts_51_011: Fix FID of EF.BCCH (details)
  25. ts_51_011: Fix EF.Phase FID (it's 6FAE, not 6FA3) (details)
  26. ts_31_102: Fix EF.NIA FID (details)
  27. ts_31_102: Fix FID of EF.OPL5G (it's 4F08 instead of 6F08) (details)
  28. ts_31_102: Fix FID + SFI of EF.MCHPPLMN (details)
  29. ts_31_102: Add DF.SAIP support (details)
  30. cards.py: support ATR-based detection of sysmoISIM-SJA5 (details)
  31. docs: add SUPI/SUCI usage example (details)
  32. cards: Add support for Gialer SIM cards (details)
  33. setup.py: fix syntax errors (missing commas) (details)
  34. modem_atcmd: raise ProtocolError instead of ReaderError on CME ERROR (details)
  35. ts_31_102: Add decoder/encoder for DF.5GS/EF.Routing_Indicator (details)
  36. ts_31_102: EF_SUPI_NAI: Decode/Encode GLI+GCI as UTF-8 strings (details)
  37. SJA2: Implement DF.SYSTEM/EF.0348_KEY using construct (details)
  38. SJA5: Add TUAK + XOR-2G algorithm definitions for EF_[U]SIM_AUTH_KEY (details)
  39. SJA5: Proper encode/decode of TUAK data in EF.USIM_AUTH_KEY (details)
  40. OTA: Fix padding of AES CMAC (details)
  41. Switch from pycryptodome to pycryptodomex (details)
  42. HPSIM application support (details)
  43. pySim-shell: Unregister TS 102 222 commands during 'equip' (details)
  44. Fix result parsing of "suspend_uicc" (details)
  45. ts_31_102: fix typo (details)
  46. Move "suspend_uicc" command from pySim-shell to ts_102_221.py (details)
  47. ts_102221: Add "resume_uicc" command (details)
  48. pySim/apdu/ts_31_102.py: Add Rel17 5G NSWO context for GET IDENTITY (details)
  49. Add FPLMN read and program (details)
  50. utils: Remove format_xplmn leading zeros in MNC (details)
  51. serial: return a return code in reset_card() (details)
  52. ts_31_102: Add shell command for GET IDENTITY (details)
  53. SJA5: EF.USIM_AUTH_KEY: Display / enforce proper length TUAK K (details)
  54. test_ota: Add one first OTA SMS AES128 unit test (details)
  55. README: rephrase initial section; add HPSIM; programmable vs. standard (details)
  56. README: remove redundancy 'Manual' and 'Documentation (details)
  57. 31.102: Fix EF.Routing_Indicator for odd number of digits (details)
  58. Add ".py" suffix to sphinx-argparse generated docs (details)
  59. pySim-shell: fix reset command (details)
  60. docs: Add section on pySim-trace to user manual (details)
  61. Add support for encoding/decoding SMS in TPDU and SMPP format (details)
  62. tests: Add new, data-driven OTA tests (details)
  63. Fix run-editor bug with cmd2 >= 2.0.0 compatibility (details)
  64. work-around what appears to be a pylint bug (details)
  65. cosmetic: Implement cmd2.Settable backwards-compat via wrapper class (details)
  66. tlv: Fix IE.from_dict() method (details)
  67. ts_31_103: enable encode tests for files containing single TLV IE (details)
  68. pySim-shell: Support USIM specific methods/commands on unknown UICC (details)
  69. pySim-shell: Unregister profile commands during equip (details)
  70. TLV_IE_Collection: use snake-style names during from_dict() (details)
  71. pySim/tlv.py: Don't create an exception from within raise (details)
  72. pySim/tlv.py: Fix TLV_IE_Collection from_dict with nested collections (details)
  73. pySim/utils: define 'Hexstr' using NewType (details)
  74. pySim/transport: More type annotations (details)
  75. pySim/commands.py: Better type annotations (details)
  76. pySim/transport: Use newly-defined ResTuple type (details)
  77. ts_102_222: Remove unneeded imports (details)
  78. GlobalPlatform ADF.SD: Add command line reference + error message (details)
  79. pySim-prog: Also accept 18-digit ICCIDs (details)
  80. filesystem: Support selecting MF from MF (details)
  81. pySim/cards: Split legacy classes away from core SIM + UICC (details)
  82. split pySim/legacy/{cards,utils} from pySim/{cards,utils} (details)
  83. pySim/cards: Add type annotations (details)
  84. create pySim.legacy.ts_51_011.py and move legacy code there (details)
  85. ts_31_102, ts_31_103: Move legacy-only code to pySim.legacy (details)
  86. cards: All derived of SimCardBase use CLA=A0; all UiccCardBase use (details)
  87. cards: cosmetic rename, argument name should be scc, not ssc (details)
  88. cards: all UICC should use sel_ctrl="0400" and SIM "0000" (details)
  89. cdma_ruim: Fix unit tests and actually enable them (details)
  90. Introduce concept of CardProfileAddon (details)
  91. ts_102_221: Remove CardProfileUICCSIM (details)
  92. pySim-shell: Iterate over CardApplication sub-classes (details)
  93. pySim/filesystem.py: remove unused class FileData (details)
  94. move Runtime{State,Lchan} from pySim.filesystem to new pySim.runtime (details)
  95. pySim-shell: Add a mode where a pySim-shell cmd can be passed by shell (details)
  96. cards: fix swapped PIN mapping number (details)
  97. pySim-shell: fix verify_adm command (details)
  98. apdu/ts_102_221: extract channel number from dict before calling (details)
  99. runtime: fix lchan deletion in method reset (details)
  100. Fixed `mnc` encoding (details)
  101. construct: add adapter Utf8Adapter to safely interpret utf8 text (details)
  102. pySim-trace: add commandline option --show-raw-apdu (details)
  103. pySim-trace: remove stray debug print (details)
  104. utils: tolerate uninitialized fields in dec_addr_tlv (details)
  105. pySim-trace: mark card reset in the trace (details)
  106. pySim-trace: catch StopIteration exception on trace file end (details)
  107. Reimplement ust_service_activate and ust_service_deactivate for (details)
  108. utils.py: remove superfluous import from itself (details)
  109. ARA-M: fix encoding of the PkgRefDO when using aram_store_ref_ar_do (details)
  110. Fix the remaining functions using the broken Card.update_ust() call (details)
  111. tests: add test script for pySim-trace (details)
  112. pysim-test: rename pysim-test.sh to pySim-prog_test.sh (details)
  113. README.md: Add note about pySim-trace.py dependencies (details)
  114. runtime: make sure applications are always listed in the same order (details)
  115. pySim-trace_test: fix shebang line (details)
  116. pySim-trace_test: verify output of pySim-trace.py (details)
  117. pySim-prog_test: fix typo (details)
  118. pySim-shell: check presence of runtime state before accessing it (details)
  119. setup.py: fix package name (details)
  120. README.md: sort dependencies, document smpp.pdu (details)
  121. cards: get rid of method read_iccid (details)
  122. sim-rest-server: do not select ADF.USIM in connect_to_card (details)
  123. sim-rest-server: use UiccCardBase instead of UsimCard (details)
  124. sim-rest-server: fix REST method info (details)
  125. sim-reset-server: fix error printing sw_match_error (details)
  126. pySim-shell: fix commandline option -a (verify_adm) (details)
  127. commands: make method verify_binary and verify_record private (details)
  128. filesystem: add attribute "leftpad" to class LinFixedEF (details)
  129. pySim-prog, pySim-shell do not use global variables (details)
  130. pySim-shell: do not pass failed card object to PysimApp (details)
  131. pySim-shell: print device info in case an exception occurs (details)
  132. transport: add return type annotation to method __str__ (details)
  133. transport: do not catch exceptions in init_reader (details)
  134. ts_31_102: Fix initialization of file size (details)
  135. Use keyword argument for file description argument (details)
  136. pySim-shell: do not fail when EF.ICCID does not exist (details)
  137. cards.py: Fix type annotation (details)
  138. pySim-shell: Create/delete RuntimeLchan objects on open/close of channel (details)
  139. RuntimeState: Add type annotation for 'card' argument (details)
  140. docs: Fix command reference for 'apdu' command (details)
  141. commands.py: Add support for multiple logical channels. (details)
  142. pySim-shell: Create + use per-RuntimeLchan SimCardCommands (details)
  143. prevent SimCardCommands.select_adf_by_aid bypassing lchan (details)
  144. pySim-shell: Add 'switch_channel' command (details)
  145. pySim-shell: Include current logical channel in prompt (details)
  146. utils: Fix bertlv_encode_tag() for multi-byte tags (details)
  147. transport: move init message into concrete classes (details)
  148. transport: move argument parser setup into concrete classes (details)
  149. Initial support for eUICC (details)
  150. euicc: Add get_profiles_info command (details)
  151. euicc: add some first IoT eUICC commands (GSMA SGP.32) (details)
  152. transport: print reader device/number on init (details)
  153. runtime: cosmetic: fix formatting of comment (details)
  154. filesystem: fix method build_select_path_to (details)
  155. docs: shell: Clarify various different card support (details)
  156. docs: shell: By now we have encoders/decoders for most files (details)
  157. docs: shell: link to cmd2 documentation (details)
  158. docs: shell: Re-order the command sections/classes (details)
  159. docs: Fix docstring syntax to avoid warnings (details)
  160. docs: shell: update output in examples (details)
  161. docs: shell: Various documentation updates/extensions (details)
  162. pySim-shell: Add copyright statement and link to online manual to banner (details)
  163. pySim-shell: Use argparser for verify_adm to support --help (details)
  164. pySim-shell: Improved argument validation for verify_adm argument (details)
  165. pySim-shell: Validate that argument to 'apdu' command is proper hexstr (details)
  166. pySim-shell: permit string with spaces for 'echo' command (details)
  167. pySim-shell: Reject any non-decimal PIN values (details)
  168. sysmocom_sja2: Add some de/encode test vectors (details)
  169. Use construct 'Flag' instead of 'Bit' for type descriptions (details)
  170. transport: Log it explicitly if user doesn't specify a reader (details)
  171. pySim-shell: Move init_card() function to new pySim.app module (details)
  172. runtime: fix tracking of selected_adf (details)
  173. ts_31_102: correct name of EF_ePDGId (details)
  174. app: do not catch exceptions in init_card (details)
  175. pySim-shell: refuse to execute a startup script on initialization errors (details)
  176. pySim-shell: Do not use self.lchan.scc when sending raw APDUs. (details)
  177. perform multiple GET RESPONSE cycles if more data is available (details)
  178. filesystem: add flag to tell whether an ADF supports an FS or not (details)
  179. ara_m: Fix encoding of DeviceInterfaceVersionDO (details)
  180. flatten_dict_lists(): Don't flatten lists with duplicate keys (details)
  181. runtime: do not use the _scc object of the card object to select MF (details)
  182. runtime: explain why we may access the card object directly (details)
  183. runtime: cosmetic: prnounce file reference data (details)
  184. tlv: Fix encoding of zero-valued TLVs (details)
  185. euicc: Fix encoding of {enable,disable,delete}_profile (details)
  186. pySim-shell: don't get trapped in applications without file system (details)
  187. euicc: the ICCID TLV object uses bcd-swapped-nibble encoding (details)
  188. euicc: Fix encoding of Lc value in STORE DATA (details)
  189. euicc: Fix TLV IE definitions for SetNickname{Req,Resp} (details)
  190. runtime: explain how file probing works (details)
  191. filesystem: use sort path when selecting an application (details)
  192. runtime: refactor file selection methods select and select_file (details)
  193. filesystem: fix typo (details)
  194. USIM: add support for EG.ePDGIdEm (Emergency ePDG) (details)
  195. usim: Add EF.ePDGSelection + EF.ePDGSelectionEm support (details)
  196. usim: ePDGId + ePDGSelection: Fix encoder/decoder + add test cases (details)
  197. usim: Properly decode/encode IPv4 + IPv6 addresses (details)
  198. bertlv_parse_len: Fix input data is smaller than num length octets (details)
  199. isim: Replace legacy imperative address TLV encoder/decoder with (details)
  200. move {enc,dec}_addr_tlv functions from pySim.util to pySim.legacy.util (details)
  201. transport: Pass argparse.Namespace directly into transport classes (details)
  202. transport/pcsc: Allow opening PC/SC readers by a regex of their name (details)
  203. transport: Move printing of reader number/name to generic code (details)
  204. transport: Extend the documentation for each transport driver (details)
  205. tests: use case-insensitive compare of hex strings (details)
  206. test/test_files: set maxDiff attribute (details)
  207. fix encode/decode of xPLMNwAcT (details)
  208. 31.102 + 51.011: Fix encode/decode of EF.CFIS (details)
  209. additional encode/decode test data for various files (details)
  210. docs/shell: extend the introduction part; link to video presentation (details)
  211. construct/tlv: Pass optional 'context' into construct decoder/encoder (details)
  212. pySim-trace_test.sh: Force termcolor to suppress color generation (details)
  213. filesystem: use pySim.utils.build_construct() (details)
  214. tlv: Fix from_dict() symmetry (details)
  215. data-driven TLV unit data test support (details)
  216. Add TLV decoder test data (details)
  217. global_platform: Correctly decode Key Information Data (details)
  218. global_platform: Add TLV test data for Key Information Data (details)
  219. global_platform: Add support for key types of v2.3.1 (including AES) (details)
  220. Fix enumeration of GlobbalPlatformISDR during card_init() (details)
  221. add PlmnAdapter for decoding PLMN bcd-strings like 262f01 to 262-01 (details)
  222. Implement convoluted encoding of UCS-2 as per TS 102 221 Annex A (details)
  223. support UCS-2 characters in EF.MMSUP, EF.ADN, EF.SPN, EF.PNN, EF.ECC (details)
  224. ts_31_102: Implement decoders/encoders for EFs below DF.HNB (details)
  225. Fix TLV_IE_Collection.from_tlv in certain situations (details)
  226. tests_files.py: Reduce code duplication (details)
  227. test_files: Test decoder also with ff-padded input (details)
  228. sysmocom_sja2: Implement EF_CHV files using construct (details)
  229. commands: Ignore exceptions during READ while UPDATE (details)
  230. global_platform: Add support for more GET DATA TLVs (details)
  231. move SUCI sub-classes to EF_SUCI_CalcInfo (details)
  232. fileystem/tlv: remove unused imports (details)
  233. ts_31_102: Start to use construct for EF.SUCI_Calc_Info (details)
  234. construct: avoid StreamError exceptions due to files containing all-ff (details)
  235. ts_31_103: Add construct for EF.GBABP and EF.GBANL (details)
  236. ts_31_103: Add TLV + construct for EF_NAFKCA (details)
  237. ts_102_310: Add file definitions resembling ETSI TS 102 310 (EAP) (details)
  238. Add pySim.esim.bsp module implementing BSP (BPP Protection Protocol) (details)
  239. add contrib/unber.py utility (details)
  240. Allow logger to do lazy evaluation of format strings (details)
  241. euicc: Fix delete_profile command (details)
  242. euicc: Fix eUICC list_notifications command (details)
  243. pySim-shell: Update manual with examples for using with eUICC ISD-R (details)
  244. Initial proof-of-concept SM-DP+ for GSMA consumer eSIM RSP (details)
  245. pySim.saip.*: Support for parsing / operating on eSIM profiles (details)
  246. euicc: Fix decoding of SubjectKeyIdentifier. (details)
  247. Constrain user input to hex-string in argparse (details)
  248. euicc: Migrate ECASD + ISD-R over to global_platform.CardApplicationSD (details)
  249. global_platform: Implement generic store_data command (details)
  250. TLV: Add DGI encoding of "GP Scripting Language Annex B" (details)
  251. global_platform: More definitions to support key loading (details)
  252. ts_102_221: Better explain 'selected file invalidated' (details)
  253. euicc: Implement EID checksum verification + computation (details)
  254. pySim-shell: Permit 'reset' command also in unqeuipped stage (details)
  255. Fix encoding of decoded/json data in update_{record_binary}_decoded (details)
  256. osmo-smdpp: Actually dump Rx/Tx JSON in JSON format and not as python (details)
  257. pySim.utils: Support datetime.datetime in JsonEncoder (details)
  258. New pySim.esim.x509_cert module for X.509 certificate handling (details)
  259. Move X.509 related code from osmo-smdpp to pySim.esim.x509_cert (details)
  260. osmo-smdpp: Implement eUICC + EUM certificate signature chain validation (details)
  261. docs: Update osmo-smdpp with pointer to sysmoEUICC1-C2T and SGP.26 (details)
  262. add contrib/eidtool.py: Tool for checking + computing EID checksum (details)
  263. docs: Add missing global_platform store_data command docs (details)
  264. global_platform: Add shell command for PUT KEY (details)
  265. osmo-smdpp: Constrain selection of CI certificate (details)
  266. ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules (details)
  267. ara_m: Use GlobalPlatform SELECT decoding (details)
  268. runtime: Reset selected_file_fcp[_hex] if SELECT returns no data (details)
  269. [cosmetic] ara_m: Give a spec reference for the PERM-AR-DO (details)
  270. saip.personalization: Also drop any fillFileOffset (details)
  271. saip.personalization: Fix ICCID fillFileContent replacement (details)
  272. esim.saip: Move OID to separate sub-module (details)
  273. esim.saip: More type annotations (details)
  274. requirements.txt: Switch to osmocom fork of asn1tools (details)
  275. add SAIP template handling + v3.1 definitions (details)
  276. osmo-smdpp: Support multiple different profiles (details)
  277. osmo-smdpp: Add more GSMA TS.48 test profiles (details)
  278. pySim.esim: Add class for parsing/encoding eSIM activation codes (details)
  279. global_platform: implement GET STATUS command (details)
  280. commands.py: Wrap the transport send_apdu* methods (details)
  281. move global_platform.py to global_platform/__init__.py (details)
  282. global_platform 'put_key': constrain ranges of KVN + KID in argparse (details)
  283. Introduce GlobalPlatform SCP02 implementation (details)
  284. pySim-shell: Make 'apdu' command use logical (and secure) channel (details)
  285. global_platform: Add install_for_personalization command (details)
  286. global_platform: add set_status command (details)
  287. global_platform: add delete_key and delete_card_content (details)
  288. global_platform: Fix --key-id argument (details)
  289. Contstrain argparse integers to permitted range (details)
  290. rename global_platform.scp02 to global_platform.scp (details)
  291. Implement Global Platform SCP03 (details)
  292. make our tests pass pylint (details)
  293. contrib/jenkins.sh: include tests/*.py in pylint (details)
  294. Be more conservative in our imports (details)
  295. global_platform: KCV support for PUT KEY (details)
  296. construct: Add StripTrailerAdapter (details)
  297. global_platform: INSTALL [for install] support (details)
  298. global_platform: Add DEK (key) encryption support (details)
  299. pylint: card_key_provider.py, card_handler.py, iso7816_4.py, jsonpath.py (details)
  300. pylint: gsmtap.py (details)
  301. pylint: cards.py (details)
  302. pylint: exceptions.py (details)
  303. pylint: ota.py (details)
  304. pylint: sms.py (details)
  305. pylint: profile.py (details)
  306. pylint: ts_31_102_telecom.py (details)
  307. pylint: app.py (details)
  308. pylint: cat.py (details)
  309. pylint: gsm_r.py (details)
  310. pylint: transport/calypso.py (details)
  311. pylint: transport/modem_atcmd.py (details)
  312. pylint: transport/pcsc.py (details)
  313. pylint: transport/serial.py (details)
  314. pylint: transport/__init__.py (details)
  315. pylint: apdu_source/__init__.py (details)
  316. pylint: apdu_source/gsmtap.py (details)
  317. pylint: apdu_source/pyshark_gsmtap (details)
  318. pylint: apdu_source/pyshark_rspro (details)
  319. pylint: apdu/ts_31_102.py (details)
  320. pylint: apdu/__init__.py (details)
  321. pylint: pySim/esim/bsp.py (details)
  322. pylint: esim/x509_cert.py (details)
  323. pylint: esim/rsp.py (details)
  324. pylint: esim/saip/personalization.py (details)
  325. pylint: esim/saip/templates.py (details)
  326. pylint: esim/saip/oid.py (details)
  327. pylint: global_platform/scp.py (details)
  328. pylint: cdma_ruim.py (details)
  329. pylint: sysmocom_sja2.py (details)
  330. pylint: ts_31_102.py (details)
  331. pylint: apdu/ts_102_221.py (details)
  332. pylint: ts_102_221.py (details)
  333. pylint: ara_m.py (details)
  334. pylint: runtime.py (details)
  335. pylint: pySim/euicc.py (details)
  336. pylint: commands.py (details)
  337. pylint: filesystem.py (details)
  338. pylint: ts_102_222.py (details)
  339. pylint: utils.py (details)
  340. pylint: tlv.py (details)
  341. pylint: construct.py (details)
  342. pylint: global_platform/__init__.py (details)
  343. global_platform: Fix INSTALL [for personalization] (details)
  344. pySim-shell: Fix regression in 'apdu' command on cards without profile (details)
  345. global_platform: Add --suppress-key-check option to put_key command (details)
  346. Introduce code for ES2+ API client functionality (details)
  347. ts_31_102: Add support for "USIM supporting non-IMSI SUPI Type" (details)
  348. Add terminal_capability command to send TERMINAL CAPABILITY (details)
  349. Dynamically determine maximum CMD data length depending on SCP (details)
  350. utils: Add function to verify Luhn check digits and to sanitize ICCIDs (details)
  351. asn1/saip: Fix typo in original ASN.1: Compontents -> Components (details)
  352. saip: profile processing; merging with templates (details)
  353. pylint: esim/saip/__init__.py (details)
  354. pylint: esim/saip/validation.py (details)
  355. saip: improve docstrings (details)
  356. osmo-smdpp: Get rid of hard-coded ICCID (details)
  357. osmo-smdpp: Add TS.48 profiles modified for unique ICCIDs (details)
  358. saip.personalization: include encode/decode of value; add validation (details)
  359. saip.personalization: Add support for SCP80/81/02/03 keys (details)
  360. saip.personalization: differentiate input_value from value (details)
  361. saip.personalization: automatically compute class 'name' attribute (details)
  362. saip.personalization: Fix encoding of ICCID in ProfileHeader (details)
  363. tests: assertEquals() is deprecated, use assertEqual() (details)
  364. docs/shell: Give users some hints on what to do if encoding/decoding (details)
  365. sysmocom_sja2: Add test vectors for EF_USIM_AUTH_KEY (details)
  366. osmo-smdpp: fix generation of transactionId (details)
  367. pySim-prog: convert from optparse to argparse (details)
  368. pcsc: open reader/card in EXCLUSIVE mode by default (details)
  369. add missing modules to setup.py (details)
  370. contrib/jenkins.sh: add 'distcheck' job to check package integrity (details)
  371. README.md: Point to simtrace mailing list (details)
  372. README.md: Link to discourse forum (details)
  373. README.md: Add link to issue tracker (details)
  374. Add funding link to github mirror (details)
  375. esim.es2p: Permit ApiParamInteger to be an actual integer (details)
  376. esim.esp2: Allow HTTP methods other than POST (details)
  377. filesystem: Enforce lower-case hex AID (details)
  378. euicc: Fix shell command for SGP.31 get_certs (details)
  379. pySim.global_platform: Fix key encryption with DEK (details)
  380. pySim-trace: Support decoding of eUICC traces (details)
  381. commands.py: Resolve possible variable use before assignment (details)
  382. commands.py: Resolve possible variable use before assignment (details)
  383. euicc.py: Resolve possible variable use before assignment (details)
  384. osmo-smdpp.py: Resolve possible variable use before assignment (details)
  385. pySim-prog.py: Resolve possible variable use before assignment (details)
  386. pySim-trace.py: Resolve possible variable use before assignment (details)
  387. euicc: clarify which eUICCs are supported (details)
  388. sysmocom_sjs2: Make sure 'Const' is imported (details)
  389. pySim/cat: Fix contruct for Address class/IE (details)
  390. pcsc: don't assume opts.pcsc_shared is present (details)
  391. contrib/sim-rest-client: don't crash without args (details)
  392. pySim/global_platform: Fix install_for_personalization command (details)
  393. pySim/commands: STATUS: Use indeterminate length Le/P3 == '00' (details)
  394. pysim/euicc: Remove duplicated code (details)
  395. runtime: Introduce an 'identity' dict for things like ATR, ICCID, EID (details)
  396. pySim-shell: Migrate PySimApp.iccid to RuntimeState.identity['ICCID'] (details)
  397. pySim.app: Attempt to retrieve the EID of a SGP.22 / SGP.32 eUICC (details)
  398. docs/shell: Mention GlobalPlatform and eUICC commands in overview (details)
  399. osmo-smdpp: Don't re-encode euiccSigned1/euiccSigned2 (details)
  400. osmo-smdpp: Make error message more descriptive (details)
  401. add globalplatform.uicc (details)
  402. [cosmetic] fix typos in comments (details)
  403. utils: Introduce BER-TLV parsers that return raw tag or even raw TLV (details)
  404. esim.bsp: Fix a bug in demac_only_one() (details)
  405. esim.saip: Introduce ProfileElement derived classes (details)
  406. esim.saip: Implement SecurityDomainSD.{add,has,remove}_key() methods (details)
  407. pySim.esim.saip.validation: Ensure unique PE identification value (details)
  408. esim.saip: Implement ProfileElement.header_name for more PE types (details)
  409. pySim.esim.saip: Meaningful constructors for [I]SD + SSD (details)
  410. document the CardKeyProvider (details)
  411. CardKeyProvider: Implement support for column-based transport key (details)
  412. global_platform/euicc: Implement obtaining SCP keys from CardKeyProvider (details)
  413. pySim-trace: Add support for the TCA Loader log file format (details)
  414. pySim.apdu: Allow TLV based decoders for APDU command and response body (details)
  415. pySim.cat: More TLV Definitions for Event Download (details)
  416. pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.cat (details)
  417. pySim.apdu.ts_102_221: Decode FETCH and TERMINAL RESPONSE body (details)
  418. pySim/cat: Decode the "Type of Comand" from numeric value to a string (details)
  419. pySim/cat: Fix "Decode the "Type of Comand" from numeric value to a (details)
  420. esim.es2p: Split generic part of HTTP/REST API from ES2+ (details)
  421. add pySim.esim.es9p with definitions of the ES9+ HTTP Interface (details)
  422. http_json_api / es9p: Add User-Agent header (details)
  423. add contrib/es9p_client: Perform ES9+ client functions like LPA+eUICC (details)
  424. esim.es9p: Suppress sending requestHeader on ES9+ (details)
  425. esim.saip: Introduce ProfileElement.identification property (details)
  426. esim.saip: Add ProfileElementSequence.remove_naas_of_type (details)
  427. pySim.tlv: Correctly parse COMPREHENSION-TLV without comprehension bit (details)
  428. pySim.cat: Make sure to always set comprehension bit in COMPR_TLV_IE (details)
  429. pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class misses (details)
  430. jenkins.sh: Include es9p_client in pylint (details)
  431. add contrib/saip-tool.py (details)
  432. pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes (details)
  433. pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd (details)
  434. pySim.ota.OtaDialectSms: Move SMS header construct up to class level (details)
  435. pySim.ota.OtaDialectSms: Implement command decoding (details)
  436. tests/ota_test.py: Allow stand-alone execution (details)
  437. osmo-smdpp: use NIST-P256 by default (details)
  438. unber.py: work-around pylint reporting (possibly-used-before-assignment) (details)
  439. contrib/jenkins.sh: Execute pylint also on all contrib python scripts (details)
  440. es9p_client: Use a plausible TAC (copy from lpac) (details)
  441. esim.saip: Remove debug print() (details)
  442. saip-tool: Add new 'info' action to print general information (details)
  443. saip-tool: Add 'extract-apps' to dump all applications from eSIM profile (details)
  444. pySim.tlv: Fix ComprTlvMeta() not passing kwargs to parent __new__ (details)
  445. pySim.esim.saip: Meaningful defaults in PE Constructor + test (details)
  446. pySim.esim: Allow calling compile_asn1_subdir() with non-DER coddec (details)
  447. pySim.esim.saip: Add ProfileElementAKA constructor + methods (details)
  448. tests: Add ProfileElementSD and ProfileElementSSD to (details)
  449. pySim.saip.oid: Properly differentiate optional from non-optional (details)
  450. pySim.esim.saip: Add ProfileElementOpt{USIM,ISIM} classes (details)
  451. pySim.saip: Add ProfileElementRFM class (details)
  452. pySim.esim.saip: Move initialization of PE header to base class (details)
  453. pySim.esim.saip: ProfileElement{Header,End} classes (details)
  454. pySim.esim.saip: Add methods to rebuild "mandatory" lists in (details)
  455. saip-tool: Dump information about security domains from "info" command (details)
  456. saip-tool: Also dump RFM information in "info" command (details)
  457. pySim.tlv: Add COMPACT_TLV_IE TLV variant (details)
  458. pySim.transport: Fix proactive_handler from_dict() calls (details)
  459. pySim.ota: Handle cases where 'secured_data' is empty (details)
  460. pySim.ota: Raise exception if encoded length would exceed 140 bytes (details)
  461. pySim.commands: Check return value of TERMINAL PROFILE command (details)
  462. transport: Implement treatment of 62xx and 63xx warning/error responses (details)
  463. pySim.cat: More spec references + explanations in comments (details)
  464. saip-tool: Fix output of TAR values in "print" subcommand (details)
  465. pySim.esim.http_json_api: 'header' is not always present in response (details)
  466. osmo-smdpp: Make sure to return empty HTTP response in (details)
  467. es9p_client: Move code into a class; do common steps in constructor (details)
  468. contrib/es9p_client: Add support for reporting notifications to SM-DP+ (details)
  469. osmo-smdpp: Implement 'other' notification signature validation (details)
  470. osmo-smdpp: Request enable/disable/delete notifications in metadata (details)
  471. pySim.esim.es8p: Add support for encoding icon in ProfileMetadata (details)
  472. pySim.globalplatform: Add 'http' submodule for GP Amd B RAM over HTTPS (details)
  473. osmo-smdpp + es9p_client: HTTP status 204 is used for handleNotification (details)
  474. pySim.ts_31_103: update to spec v18.1.0 Release 18 (details)
  475. move parts of pySim.ts_31_103 to pySim.ts_31_103_shared (details)
  476. [cosmetic] ts_31_102: Note in comment which release introdcued recent (details)
  477. ts_31_102: Make use of ts_31_103_shared and add Rel 18 files (details)
  478. pySim.ts_31_102: Fix name of EF.VBSCA (details)
  479. pySim.apdu: Refactor cmd_to_dict() method (details)
  480. pySim.apdu: Fix APDU CLA matching (details)
  481. pySim.apdu.ts_102_222: APDU decoding for administrative commands (details)
  482. pySim-trace: display decoded result as JSON, not as python dict (details)
  483. pySim.apdu: Get rid of HexAdapter (details)
  484. runtime: add missing docstring (details)
  485. runtime: rename get_file_for_selectable to get_file_for_filename (details)
  486. ts_31_103_shared: fix file structure of EF.WebRTCURI (details)
  487. pySim-shell: fix comment formatting (details)
  488. pySim.ota: Add construct definition for SIM File + TK Param definition (details)
  489. pySim.apdu.global_platform: Decode the INSTALL command parameters (details)
  490. saip-tool: Fix TAR display for implicit TAR (details)
  491. pySim.global_platform.ota: Support KVN 0x70 for SCP02 (details)
  492. pySim-shell: move export code into filesystem class model (details)
  493. pySim-shell: turn "ADF-escape-code" into an lchan method. (details)
  494. pySim-shell: fix reset command (details)
  495. pySim-shell: clean up method calls in do_switch_channel (details)
  496. pySim-shell: fix comment formatting (details)
  497. ara_m: fix sourcecode formatting (details)
  498. ara_m: fix misspelled object name (details)
  499. pySim.esim.saip: Add OID comparison functions (details)
  500. pySim.esim.saip: Decode each 'File' element in ProfileElement (details)
  501. pySim.tlv: Add convenience methods to IE class (details)
  502. pySim.runtime: Be more verbose if incompatible method is called (details)
  503. pySim.commands: Don't convert SwMatchError to ValueError (details)
  504. pySim.tlv: Separate {to,from}_val_dict() from {to,from}_dict() (details)
  505. pySim-shell: add "fsdump" command (details)
  506. pySim.commands: make use of status word interpreter for CHV (details)
  507. pySim.filesystem: Add Path for abstraction/utility around file system (details)
  508. pySim.ts_102_221: Fix FileDescriptor encoding for BER-TLV case (details)
  509. pySim.ts_102_221: Add ProprietaryInformation sub-IEs of TS 102 222 (details)
  510. pySim.esim.saip: Initial support for parsing GenericFileManagement (details)
  511. Reference pySim.filesystem derived classes from SAIP templates (details)
  512. Fix missing AIDs in pySim.saip templates (details)
  513. pySim.esim.saip.templates: Build tree from template files (details)
  514. pySim.esim.saip: Refactor from_der() method to have class_for_petype() (details)
  515. pySim.esim.saip: Add subclasses for gsm-access, phonebook, 5gs, saip (details)
  516. ara_m: Fix pySim.tlv.IE.from_dict() calls (details)
  517. pySim.tlv: Fix from_dict of nested TLVs (details)
  518. Support EF.ICCID and EF.PL on classic TS 51.011 SIM (details)
  519. pySim-shell: Support hexadecimal ADM pin in 'verify_adm' (details)
  520. pySim-shell: Support other ADMx values beyond ADM1 from 'verify_adm' (details)
  521. pySim.esim.saip: Add subcasses for EAP, DF.SNPN and DF.5G_ProSe (details)
  522. pySim.esim.saip.template: Permit file-size for BER-TLV files (details)
  523. pySim.esim.saip.templates: Add a notion of the path of a file (details)
  524. pySim.esim.saip.templates: Update to SAIP v3.3.1 (July 2023) (details)
  525. pySim.filesystem: Add __len__ method to Path object (details)
  526. pySim.esim.saip.oid: Fix OID defininitions for v3.3.1 IoT templates (details)
  527. pySim-shell: fix typo (details)
  528. pySim.esim.saip.templates: Add SaipSpecVersion (details)
  529. pySim.esim.saip.templates: Explicitly specifiy repeatable default value (details)
  530. pySim.esim.saip.templates: Fix '...' notation in default value (details)
  531. pySim.esim.saip.templates: Add expand_default_value() method (details)
  532. ara_m: fix --apdu-filter setting (details)
  533. pySim.cards: Make file_exists() check for activated/deactivated (details)
  534. filesystem: add placeholder export method in CardFile base class (details)
  535. filesystem: add export method for ADF files (details)
  536. ara_m: add export support for the ARA-M application (details)
  537. filesystem: fix typo (details)
  538. runtime: integrate escape route for applications without ADF support (details)
  539. runtime: add method to lookup a file by name without selecting it (details)
  540. pySim-shell: improve export and enable exportation of DF and ADF files (details)
  541. pySim-shell: improve fsdump (details)
  542. pySim.esim.saip.templates: Introduce dependency/hierarchy information (details)
  543. pySim.ts_102_221: Make sure FileDescriptor for BER-TLV contains (details)
  544. pySim.filesystem: Permit Path object construction from FID integer list (details)
  545. saip-tool: Set default log level to INFO (instead of DEBUG) (details)
  546. pySim.esim.saip.oid: Allow OID instance in prefix_match() (details)
  547. contrib/saip-tool: Add command-line arguments to configure log level (details)
  548. pySim.esim.saip: Improve File.from_template feature support (details)
  549. pySim.esim.saip: Refactor file size encoding into a method (details)
  550. pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass (details)
  551. pySim.esim.saip: pass up **kwargs from ProfileElement sub-class (details)
  552. pySim.esim.saip: Back-reference from ProfileElement to (details)
  553. pySim.esim.saip: Add some more docstring comments (details)
  554. pySim.esim.saip: Fix typo in ProfileElementAKA.set_mapping() method (details)
  555. pySim.esim.saip: Fix key used in FsProfileElement.files2pe (details)
  556. pySim.esim.saip.File: move away from stream for file content (details)
  557. jenkins: use osmo-clean-workspace.sh before and after build (details)
  558. pySim.esim.saip: maintain a parsed fileystem hierarchy (details)
  559. Fix pySim.esim.es2p.Param.timestamp._encode (details)
  560. osmo-smdpp: Proper error handling in case ctxParams1 is missing member (details)
  561. contrib/saip-tool: Add 'tree' command to display filesystem tree of (details)
  562. runtime: fix get_file_by_name (details)
  563. pySim-shell: fix CardKeyProvider for chv management commands (details)
  564. filesystem: fix double space in docstring (details)
  565. pySim-shell: fix sourcecode formatting (details)
  566. filesystem: add command to delete all contents from a BER-TLV EF (details)
  567. pySim-shell, cosmetic: define positional arguments last (details)
  568. pySim-shell: prevent opening/closing logical channel 0 (details)
  569. pySim.esim.saip: Add missing entry for 'rfm' to class4petype (details)
  570. global_platform: fix help description for establish_scp03 (details)
  571. global_platform: use scp_key_identity ICCID for ADF.ISD (details)
  572. ara_m: use class byte of current lchan (details)
  573. commands: get rid of cla4lchan (details)
  574. scp: fix key length in dek_encrypt and dek_decrypt (details)
  575. ts_31_102: Add mssing help string for get_identity parameter (details)
  576. suci-tutorial: fix incorrect hnet_pubkey value (details)
  577. tests: move unittests into a sub directory (details)
  578. contrib: script to generate "update" commands from diff of fsdumps (details)
  579. tests: move pySim-trace test and its data into a sub directory (details)
  580. tests: move pySim-prog test and its data into a sub directory (details)
  581. suci-tutorial: put download links for specs to the front (details)
  582. suci-tutorial: fix spec reference (details)
  583. pySim-prog_test: tolerate empty reader slots (details)
  584. pySim-prog_test: tolerate missing .data files (details)
  585. pySim-prog_test: supress stderr when probing for cards (details)
  586. contrib/jenkins.sh: Install dependencies before calling pylint (details)
  587. Migrate over to using pyosmocom (details)
  588. remove pySim.gsmtap as it has moved to osmopython.gsmtap (details)
  589. pySim.esim.saip: Fix weird DF names (details)
  590. pySim.esim.saip: Another naming irregularity. (details)
  591. pySim.esim.saip: Add missing initialization of File.df_name (details)
  592. pySim.esim.saip.File: Turn file_size into a computed property (details)
  593. pySim.esim.saip.ProfileElementGFM: Initialize 'fileManagementCMD' (details)
  594. esim.saip.templates: Fix expand_default_value_pattern for length==0 (details)
  595. commands: avoid double lchan patching, get rid of cla_byte getter+setter (details)
  596. pySim-shell: rework startup procedure and introduce non interactive mode (details)
  597. suci-tutorial: add section about SUCI calculation by the USIM (details)
  598. pySim-shell: do not display 'AIDs:' when there are none (details)
  599. pySim-shell: use upper case letters for positional arguments (details)
  600. suci-tutorial: fix typo s/symo/sysmo/ (details)
  601. transport: define TERMINAL RESPONSE content within ProactiveHandler (details)
  602. pySim.app: Properly reset card state after reading EID (details)
  603. pySim.transport: Add support for generic stdout apdu tracer (details)
  604. pySim.transport: Also trace card reset events in ApduTracer (details)
  605. pySim.commands: use _checksw during get_data() method (details)
  606. pySim.euicc: Add 'get_data sgp02_eid' in ADF.ECASD of M2M eUICC (details)
  607. pySim-shell: print cardinfo hexstrings in lowercase (details)
  608. pySim-prog: fix sourcecode formatting (details)
  609. pySim-prog: fix sourcecode formatting (details)
  610. pySim/profile: Change match_with_profile from static to class method (details)
  611. pySim.profile: Further refactor card <-> profile matching (details)
  612. pySim-shell: Detect different eUICC types and print during start-up (details)
  613. docs: remove traces of modules migrated to pyosmocom (details)
  614. docs: Bring osmo-smdpp documentation up to date with code (details)
  615. update pyosmocom dependency to 0.0.3 (details)
  616. pySim-prog: add FIXME note to tell that writing hlr.db files is broken (details)
  617. pySim-prog: treat --imsi and --iccid equally (details)
  618. pySim-prog: fix commandline parameter check for CSV mode (details)
  619. pySim-prog: rework documentation (details)
  620. runtime: add new API functions to get the record len and file size (details)
  621. filesystem, cosmetic: remove excess whitespace (details)
  622. pySim-shell: improve command "desc" (details)
  623. requirements: require at least construct version 2.10.70 (details)
  624. pySim-prog_test: do not set an ICCID parameter for sysmoISIM-SJA2 (details)
  625. pySim-prog_test: individual ICCIDs for all cards (details)
  626. pySim-shell: recognize ADP pins longer than 8 digits as hexadecimal (details)
  627. pySim-prog_test: add test vectors for sysmoISIM-SJA5 (details)
  628. Add testsuite for pySim-shell with real cards (details)
  629. gitignore: add files generated with jenkins.sh (details)
  630. contrib/jenkins: add SKIP_CLEAN_WORKSPACE (details)
  631. pySim-shell_test: disable test_list_and_rm_notif (details)
  632. pySim-shell: New '-e' command line argument (details)
  633. filesystem: pass total_len to construct of when encoding file contents (details)
  634. cosmetic: use **kwargs instead of **_kwargs (details)
  635. ts_51_011: replace encoding of EF.MSISDN with construct model (details)
  636. ts_51_011: fix unittest for EF.ADN (details)
  637. ts_51_011: use _test_de_encode instead of _test_decode in EF.CFIS (details)
  638. ts_102_221: se _test_de_encode instead of _test_decode in EF.DIR (details)
  639. utils: move enc_msisdn and dec_msisdn to legacy/utils.py (details)
  640. tests: sanitize all cards before running tests (details)
  641. jenkins: build docs in virtualenv as well (details)
  642. docs/Makefile: make SPHINXBUILD work in venv (details)
  643. pySim.euicc: Fix ASN.1 encoding of integer values (details)
  644. pySim-shell_test: re-enable test_list_and_rm_notif (details)
  645. docs/shell: Add missing :ref: when referencing other command (details)
  646. pySim.esim.saip.templates: Fix DF_TELECOM FileID (7F10, not 7F11) (details)
  647. global_platform: ensure ArgumentParser gets a list for choices (details)
  648. pySim.ts_31_102: Add support for EF.EARFCNList (details)
  649. pySim-shell_test/utils: delete log files in general (details)
  650. pySim-shell_test/utils: enumerate pySim-shell logs (details)
  651. pySim-shell_test/utils: display pySim-shell logfile content (details)
  652. commands: fix typo (details)
  653. global_platform/scp: fix typo (details)
  654. commands: fix double space character in apidoc (details)
  655. commands: fix apidoc (wrong order of parameters) (details)
  656. pySim-shell-test: improve global platform tests (details)
  657. global_platform/scp: mapdu may be undeclared (details)
  658. pySim-shell_test/utils: print logfile on all types of errors (details)
  659. pySim-shell: allow checking of APDU responses (details)
  660. pySim-shell: fix reset command for no-profile mode (details)
  661. pySim-shell: add new commandline option "--skip-card-init" (details)
  662. pySim-shell_test/utils: treat cmd2 error "not a recognized command... as (details)
  663. docs/osmo-smdpp: fix markup (details)
  664. docs/osmo-smdpp: fix typo (details)
  665. docs/legacy: remove unused '::' paragraph. (details)
  666. docs/osmo-smdpp: restructure subsection "osmo-smdpp" (details)
  667. global_platform/scp: refactor _wrap_cmd_apdu (details)
  668. pySim/transport add support for T=1 protocol and fix APDU/TPDU layer (details)
  669. pySim-shell_test: add new testcase for card initialization (details)
  670. docs: add topic about remote UICC/eUICC access (details)
  671. esim.saip: Fix parsing/generating fillPattern + repeatPattern (details)
  672. pySim.esim.saip: Treat "Readable and Updateable when deactivated" flag (details)
  673. esim.saip: Compute number of records from efFileSize and record_len (details)
  674. esim.saip: Fix computation of file content (details)
  675. [cosmetic] esim.saip: Fix various typos in comments/docs/messages (details)
  676. [cosmetic] esim: Fix various typos in comments/messages/docs (details)
  677. esim.saip: New methods for inserting ProfileElement into sequence (details)
  678. esim.saip.File: Re-compute file_size when changing body (details)
  679. esim.saip.File: Proper ARR conversion of template (into) to file (bytes) (details)
  680. esim.saip.File: Suppress encoding attributes that are like template (details)
  681. esim.saip.FsProfileElement: Add create_file() method (details)
  682. esim.saip.ProfileElementUSIM: Fix IMSI decode if [only] template based (details)
  683. docs: Add documentation about contrib/sim-rest-{server,client} (details)
  684. contrib/esim-qrcode.py: Small command line tool to encode eSIM QR codes (details)
  685. contrib/suci-keytool.py: Convenience tool for SUCI key generation (details)
  686. es2p_client: Print the activation code after confirmOrder success (details)
  687. docs/shell: Fix documentation for eUICC ISD-R specific commands (details)
  688. Fixing 3-digit MNC PLMN Encoding/Decoding tests expected values for (details)
  689. ts_31_102: fix testcase for EF_ePDGSelection (details)
  690. pySim-shell: reset card in method equip (details)
  691. pySim-shell: change Prompt character to "#" after "verify_adm" (details)
  692. README.md update / re-wording (details)
  693. ara_m: fix spec reference. (details)
  694. ara_m fix export of AID-REF-DO (empty) (details)
  695. javacard, cosmetic: fix sourcecode fromatting and improve docstring (details)
  696. global_platform: remove unused code (details)
  697. global_platform: fix command "delete" (details)
  698. global_platform: add spec reference to help of --install-parameters (details)
  699. javacard: add parser for JAVA-card CAP file format (details)
  700. cards: Avoid exception seen with (some) GSM-R SIM cards (details)
  701. global_platform: fix usage of the Key Version Number (kvn) (details)
  702. global_platform: LOAD and INSTALL [for load] support (details)
  703. global_platform: add new command "install_cap" (details)
  704. ATR: use lowercase hex strings without spaces as ATR constants (details)
  705. ATR: align get_atr() return value type (details)
  706. pySim/transport: add abstract get_atr method to LinkBase (details)
  707. .gitignore: dist subdir, may be created by pip (details)
  708. setup.py: install esim.asn1 resources, install esim.saip (details)
  709. euicc: Add euicc_memory_reset shell command (details)
  710. pySim-shell: obey quit command in startup commands+scripts (details)
  711. docs/osmo-smdpp.rst: fix typo apostrophe (details)
  712. osmo-smdpp.py: enable --host and --port cmdline args (and document) (details)
  713. add PEM cert as used in docs/osmo-smdpp.rst (details)
  714. .gitignore tags (from ctags) (details)
  715. .gitignore: smdpp-data/sm-dp-sessions from running osmo-smdpp.py (details)
  716. pylint: personalization.py: fix E1135: permitted_len (details)
  717. pylint: ota.py: fix E0606 possibly-used-before-assignment (details)
  718. filesystem: do not decode short TransRecEF records (details)
  719. es8p: fix typo (details)
  720. pySim/commands: Fix envelope command APDU case after T=1 support (details)
  721. [cosmetic] pySim.transport: Fix spelling/typos in comment (details)
  722. saip-tool: add function to write PE sequence (details)
  723. saip-tool: add option to extact profile elements to file (details)
  724. saip-tool: allow removing of profile elements by type (details)
  725. saip-tool: add ProfileElement class for application PE (details)
  726. pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing (details)
  727. saip-tool: add features to add, remove and inspect application PEs (details)
  728. ara_m: add command to lock write access to the ARA-M rules. (details)
  729. saip-tool: add commandline option to edit mandatory services list (details)
  730. doc/card-key-provider: fix WARNING: Title underline too short (details)
  731. filesystem: fix WARNING: Block quote ends without a blank line (details)
  732. docs/saip-tool: fix ERROR: Unexpected indentation (details)
  733. edit_{binary,record}_decoded: Support hex-decode of bytes (details)
  734. osmo-smdpp: Renew SGP.26 TLS certificate for SM-DP+ (details)
  735. Use osmocom.construct.{Bytes,GreedyBytes} for hexstring input support (details)
  736. jenkins.sh: workaround for 'usage: build.py' in docs (details)
  737. docs: Build the pySim.esim library documentation (details)
  738. docs: Better python doc-strings for better pySim.esim manual (details)
  739. Get rid of [now] superfluous HexAdapter (details)
  740. smdpp: optional deps (details)
  741. smdpp: update certs (details)
  742. smdpp: verify request headers (details)
  743. smdpp: Verify EID is within permitted range of EUM certificate (details)
  744. smdpp: reorder imports (details)
  745. smdpp: add proper tls support, cert generation FOR TESTING (details)
  746. smdp: clean up accidental commited trash (details)
  747. smdpp: less verbose by default (details)
  748. x509 cert: fix weird cert check (details)
  749. smdpp: verify cert chain (details)
  750. smdpp: add proper brp cert support (details)
  751. smdpp: fix asn1tool OBJECT IDENTIFIER decoding (details)
  752. memory backed ephermal session store for easy concurrent runs (details)
  753. smdp: update tls certs (details)
  754. requirements: set cmd2>=2.6.2,<3.0 (details)
  755. docs: fix authors line exceeding the page (details)
  756. Make sure to select MF before probing for files/Addons (details)
  757. Identify cards by Historical bytes of ATR (details)
  758. docs/suci-keytool.rst: spelling fix (details)
  759. bsp: fix maxpayloadsize (details)
  760. Fix typos (details)
  761. pySim.esim.saip.FsNodeADF: Fix __str__ method (details)
  762. Pass pylint 3.3.4 from debian trixie (details)
Commit 0707b80ad3b8781958da7fd0bef3f0ef38562d12 by laforge
ts_102_222: Implement support for RESIZE FILE for an EF

This adds pySim-shell support for the RESIZE FILE command in order
to change the size of linear fixed or transparent EF.

Change-Id: I03fbb683e26231c75f345330ac5f914ac88bbe7a
The file was modifieddocs/shell.rst
The file was modifiedpySim/ts_102_222.py
The file was modifiedpySim/commands.py
Commit 308d7cdf7814860670950c59965db7c7d9263680 by Oliver Smith
docs/Makefile: don't forward shrink to sphinx

Adjust the catch-all target at the end of the Makefile that is supposed
to route all unknown targets to sphinx, so it doesn't do this for the
shrink target. The shrink target has recently been added to
Makefile.common.inc in osmo-gsm-manuals, which gets included right above
the catch-all target. So it isn't an unknown target, but for some reason
the sphinx catch-all runs in addition to the shrink target (runs
shrink-pdfs.sh, see output below) and fails. As I did not add the
catch-all logic, preserve it but add an exception for the shrink rule.

Fix for:
  + make -C docs publish publish-html
  make: Entering directory '/build/docs'
  /opt/osmo-gsm-manuals/build/shrink-pdfs.sh _build/latex/osmopysim-usermanual.pdf
  * _build/latex/osmopysim-usermanual.pdf: 272K (shrunk from 336K)
  Running Sphinx v5.3.0

  Sphinx error:
  Builder name shrink not registered or available through entry point

Related: SYS#6380
Change-Id: If2802bb93909aba90debe5e03f3047cec73e2f54
The file was modifieddocs/Makefile
Commit 41fbf12dba06450b60d05fa363ad1a8fdb395153 by Oliver Smith
gitignore: add manuals related files

Change-Id: I93a63b33032f93f381b8ef451aecc97d3011ce8c
The file was modified.gitignore
Commit 1dd5cb540da0b7346482a16698ef8f5d74487fdb by laforge
fix SimCardCommands.run_gsm(): always use CLA=0xa0

Depending on the card type (SIM or USIM/ISUM), self.cla_byte may
be either 0xa0 or 0x00.  Sending RUN GSM ALGORITHM with CLA=0x00
fails with SW=6985 (Command not allowed), so let's make sure
that we always use CLA=0xa0 regardless of the card type.

Change-Id: Ia0abba136dbd4cdea8dbbc3c4d6abe12c2863680
The file was modifiedpySim/commands.py
Commit 9970f59f4fd0a51da2b2e3a8194e6d6af0468581 by laforge
SimCardCommands.run_gsm(): use send_apdu_checksw()

Change-Id: Ib713cf8154a3aba72bc5776a8d99ec47631ade28
The file was modifiedpySim/commands.py
Commit 61ef1571f998efa42490c6cfdf0e6bb2e606115f by laforge
pySim-shell.py: add a command for RUN GSM ALGORITHM

Change-Id: Id7876d83d018aca79253784411d3a9d54a249a0a
The file was modifiedpySim/ts_51_011.py
Commit 7b9e24482d5615b0ae87c77fd90989314f4acbe7 by pmaier@sysmocom.de
pySim-shell: add cardinfo command

It may sometimes be helpful to get a bit of general information about
the card. To sort out problems it sometimes helps to get an idea what
card type and ICCID pySim-shell has in memory.

Change-Id: If31ed17102dc0108e27a5eb0344aabaaf19b19f9
The file was modifiedpySim-shell.py
Commit 0d80fa9150f014c5cb1db57462a06d14f1ea0338 by Vadim Yanitskiy
pySim-prog.py: fix SyntaxWarning: using is with a literal

Change-Id: If9460bf827242a1dfc518213e3faa9137a21869a
The file was modifiedpySim-prog.py
Commit b34f23448ce2efb2dc79e6c07819c10fe4947953 by Vadim Yanitskiy
filesystem: define more convenient codec for EF.ACC

This patch improves the output of the 'read_binary_decoded' command:

pySIM-shell (MF/DF.GSM/EF.ACC)> read_binary_decoded
{
    "ACC0": false,
    "ACC1": false,
    "ACC2": false,
    "ACC3": false,
    "ACC4": false,
    "ACC5": false,
    "ACC6": false,
    "ACC7": false,
    "ACC8": false,
    "ACC9": false,
    "ACC10": false,
    "ACC11": false,
    "ACC12": false,
    "ACC13": false,
    "ACC14": false,
    "ACC15": true
}

And allows to set/unset individual ACCs using 'update_binary_decoded':

pySIM-shell (MF/DF.GSM/EF.ACC)> update_binary_decoded --json-path 'ACC15' 0
"0000"
pySIM-shell (MF/DF.GSM/EF.ACC)> update_binary_decoded --json-path 'ACC8' 1
"0100"
pySIM-shell (MF/DF.GSM/EF.ACC)> update_binary_decoded --json-path 'ACC0' 1
"0101"

Change-Id: I805b3277410745815d3fdc44b9c0f8c5be8d7a10
Related: SYS#6425
The file was modifiedpySim/ts_51_011.py
Commit e63cb2cc4da2ee3730408e372395e80e4751277c by Vadim Yanitskiy
setup.py: add missing pySim-trace.py' to scripts[]

Change-Id: I44dfcf48ae22182bd7aaa908559f3d1e1e31acce
The file was modifiedsetup.py
Commit 6b19d802294159589ff0fe44fb74b9c03b92d638 by laforge
ts_51_011: fix EF_ServiceTable: use self for static method

Even though _bit_byte_offset_for_service() is a @staticmethod, it's
still available via self, just like any non-static method.

Change-Id: I3590dda341d534deb1b7f4743ea31ab16dbd6912
The file was modifiedpySim/ts_51_011.py
Commit 87dd020d5fbcfadb994d5c808868ee6a0d178fe6 by laforge
Add very basic profile for R-UIM (CDMA) cards

R-UIM (CDMA) cards are pretty much like the normal GSM SIM cards and
"speak" the same 2G APDU protocol, except that they have their own file
hierarchy under MF(3f00)/DF.CDMA(7f25).  They also have DF.TELECOM(7f10)
and even DF.GSM(7f20) with a limited subset of active EFs.  The content
of DF.CDMA is specified in 3GPP2 C.S0023-D.

This patch adds a very limited card profile for R-UIM, including auto-
detecion and a few EF definitions under DF.CDMA.  This may be useful
for people willing to explore or backup their R-UIMs.  To me this was
useful for playing with an R-UIM card from Skylink [1] - a Russian
MNO, which provided 450 MHz CDMA coverage until 2016.

[1] https://en.wikipedia.org/wiki/Sky_Link_(Russia)

Change-Id: Iacdebdbc514d1cd1910d173d81edd28578ec436a
The file was modifiedpySim/ts_51_011.py
The file was addedpySim/cdma_ruim.py
The file was modifiedpySim/profile.py
The file was modifiedpySim-shell.py
Commit 93aac3abe6b536984f369bc4d07087801fb97807 by pmaier@sysmocom.de
pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable)

In cmd2 relase 2.0.0 the constructor of Settable adds a settable_object
parameter, which apparantly was optional at first, but then became
mandatory. Older versions must not have the settable_object parameter
but versions from 2.0.0 on require it. Let's add a version check so that
we stay compatible to cmd2 versions below and above 2.0.0.

See also: https://github.com/python-cmd2/cmd2

Commit 486734e85988d0d0160147b0b44a37759c833e8a
Author: Eric Lin <anselor@gmail.com>
Date:   2020-08-19 20:01:50

and

Commit 8f981f37eddcccc919329245b85fd44d5975a6a7
Author: Eric Lin <anselor@gmail.com>
Date: 2021-03-16 17:25:34

This commit is based on pySim gerrit change:
Ifce40410587c85ae932774144b9548b154ee8ad0

Change-Id: I38efe4702277ee092a5542d7d659df08cb0adeff
The file was modifiedsetup.py
The file was modifiedpySim-shell.py
The file was modifiedrequirements.txt
The file was modifiedREADME.md
Commit c85d4067fdbf641f6ca63be862023c0aca726c29 by pmaier@sysmocom.de
pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (include_ipy)

In version 2.0.0, the use_ipython parameter in the Cmd constructor is
renamed to include_ipy. There are still plenty of older cmd2
installations around, so let's work around this using a version check.

See also: https://github.com/python-cmd2/cmd2

Commit: 2397280cad072a27a51f5ec1cc64908039d14bd1
Author: Kevin Van Brunt <kmvanbrunt@gmail.com>
Date: 2021-03-26 18:56:33

This commit is based on pySim gerrit changes:
Ifce40410587c85ae932774144b9548b154ee8ad0
I19d28276e73e7024f64ed693c3b5e37c1344c687

Change-Id: Ibc0e18b002a03ed17933be4d0b4f4e86ad99c26e
The file was modifiedpySim-shell.py
Commit 961b803ec4b04e83fdec54b03c9d3345de17c3d0 by pmaier@sysmocom.de
pySim-shell: fix compatibility problem with cmd2 >= 2.3.0 (bg)

cmd2.fg and cmd2.bg have been deprecated in cmd2 2.3.0 and removed
in cmd2 2.4.0. Let's work around this by a version check.

Related upstream commits:
(See also: https://github.com/python-cmd2/cmd2)

Commit f57b08672af97f9d973148b6c30d74fe4e712d14
Author: Kevin Van Brunt <kmvanbrunt@gmail.com>
Date:   Mon Oct 11 15:20:46 2021 -0400

and

Commit f217861feae45a0a1abb56436e68c5dd859d64c0
Author: Kevin Van Brunt <kmvanbrunt@gmail.com>
Date:   Wed Feb 16 13:34:13 2022 -0500

Change-Id: I9fd32c0fd8f6d40e00a318602af97c288605e8e5
The file was modifiedpySim-shell.py
Commit f8a3d2b3db86a9644e0585c954d36bd87c454494 by pmaier@sysmocom.de
requirements.txt: allow cmd2 versions greater than 1.5

Since we now have fixed the compatibility issues with recent cmd2
versions, we may allow also versions greater than 1.5 in the
requirements.txt

Change-Id: I87702c5250a3660c84458939167bffdca9c06059
The file was modifiedsetup.py
The file was modifiedREADME.md
The file was modifiedrequirements.txt
Commit 2b15e315e2d2b573787d9bd99f84c61086683547 by pmaier@sysmocom.de
setup: add missing pyyaml to setup.py and README.md

Change-Id: I1d35f38b17a315dd58e8dd91a27bfa6c2c85905d
The file was modifiedsetup.py
Commit 3bcc22f73dfa7d1823d6f405ce6cffb6bebeeb0b by pmaier@sysmocom.de
README.md: add missing pycryptodome to dependency list

Change-Id: Ib3cf13a1ad38749ac82d1b36fa32d9c5aba29e1a
The file was modifiedREADME.md
Commit e47ea5f2e574491e69d9eb8ab9ee6fe13c7d78d5 by Oliver Smith
Fix pylint errors

In a previous patch the dependency on cmd2 was changed from cmd2==1.5 to
cmd2>=1.5. After this was merged, this lead to the docker images getting
rebuilt and now having a higher cmd2 version that gets used in the CI
checks. So while the patch was in review, pylint was actually running
with a lower cmd2 version and was taking different code paths.

Fix for:
pySim-shell.py:30:4: E0611: No name 'fg' in module 'cmd2' (no-name-in-module)
pySim-shell.py:30:4: E0611: No name 'bg' in module 'cmd2' (no-name-in-module)
pySim-shell.py:154:8: E1123: Unexpected keyword argument 'use_ipython' in method call (unexpected-keyword-arg)
pySim-shell.py:171:30: E1120: No value for argument 'settable_object' in constructor call (no-value-for-parameter)
pySim-shell.py:173:30: E1120: No value for argument 'settable_object' in constructor call (no-value-for-parameter)
pySim-shell.py:175:30: E1120: No value for argument 'settable_object' in constructor call (no-value-for-parameter)
pySim-shell.py:176:30: E1120: No value for argument 'settable_object' in constructor call (no-value-for-parameter)

Fixes: f8a3d2b3 ("requirements.txt: allow cmd2 versions greater than 1.5")
Fixes: OS#6034
Change-Id: I182d3a2b87e70ed551a70c88d3d531a36bf53f53
The file was modifiedpySim-shell.py
Commit a793552b4fb9caefdcc345f629390481d557431c by Oliver Smith
contrib/jenkins.sh: print pylint version before running it

Change-Id: Icc96ff16af482581dc97a387bcff1374fbb620f3
Related: OS#6034
The file was modifiedcontrib/jenkins.sh
Commit ade366d2a9bc319d5f353f648b9e7f390de80715 by Vadim Yanitskiy
setup.py: add missing packages for pySim-trace.py

pySim-trace.py is broken if pySim is installed using setup.py:

  fixeria@DELL:~$ pySim-trace.py
  Traceback (most recent call last):
    File "/usr/bin/pySim-trace.py", line 8, in <module>
      from pySim.apdu import *
  ModuleNotFoundError: No module named 'pySim.apdu'

Change-Id: I371143cb4009db46275ec7a020497b909dcc3b4e
The file was modifiedsetup.py
Commit c224b3b5f1449661ba85e4970c749c1a16167b47 by laforge
ts_51_011: Add sst_service_[de]{activate,allocate} shell commands

Just like the existing commands for UST/IST: Allow the user to
activate/deactivate individual services.  As EF.SST also contains
information about "allocation" of a service, let's have commands for
allocation and activation.

Change-Id: If959d06248cb1a9d2c0a21cdd40d438726cbc5f0
The file was modifiedpySim/ts_51_011.py
The file was modifieddocs/shell.rst
Commit fc67de22192f8aa67c80dd0c8943ceb5b5cd13fe by laforge
ts_31_102: Extend from Rel16 to Rel17

This adds definitions for a variety of files which were added in Release
17 of 3GPP TS 31.102.

Change-Id: I61badc1988b006a1065bdfdcc8a93b758e31f79b
The file was modifiedpySim/ts_31_102.py
Commit 10a1a0a22e5d2998172bccc30cdb893c8e773ddf by laforge
ts_51_011: Fix FID of EF.BCCH

It's 6F74, not 6F7F! (see TS 51.011 Section 10.3.14)

Change-Id: I9d90fa05a0f926f99a5d4832341cc8a9449df7ae
The file was modifiedpySim/ts_51_011.py
Commit 33eef850c006bce946c026007b0bf907af5d7225 by laforge
ts_51_011: Fix EF.Phase FID (it's 6FAE, not 6FA3)

Change-Id: I11df83b17b8d6eaab309908cbee646c888abab0d
The file was modifiedpySim/ts_51_011.py
Commit 04bd5140fddd9eee4440122d7882663414885094 by laforge
ts_31_102: Fix EF.NIA FID

The FID in ADF.USIM is different from the FID in DF.GSM.  So while
we can re-use the ts_51_011 EF_NIA class definition, we must pass in
a different fid to the constructor.

Change-Id: Ib414d5b476666e276824266e33b341175a2ee05a
The file was modifiedpySim/ts_31_102.py
Commit 5206429c0c3d0bd777ba0abb5f652b6b4685bb8e by laforge
ts_31_102: Fix FID of EF.OPL5G (it's 4F08 instead of 6F08)

Change-Id: I68c7ad93dabd768d80ae629498aee29d7bab5542
The file was modifiedpySim/ts_31_102.py
Commit 24e77a775815e90cb9f04ae9157ddc2fcee87eff by laforge
ts_31_102: Fix FID + SFI of EF.MCHPPLMN

Change-Id: I7e24c904e47cc6f90e90b8634cbed478bd14231f
The file was modifiedpySim/ts_31_102.py
Commit 2bee70cbac8c2fbff4c8809e125dc4833884e4a3 by laforge
ts_31_102: Add DF.SAIP support

DF.SAIP (SIMalliance Interoperable Profile) is not part of 31.102,
but something from the eSIM/eUICC universe of TCA (formerly known as
SIMalliance).  However, as 3GPP does not specify how/where the card
stores the information required for SUCI calculation, the
TCA/SIMalliance standard is the only standard there is.  Some CardOS
start to use this standard even for non-eSIM/eUICC use cases.

Change-Id: Iffb65af335dfdbd7791fca9a0a6ad4b79814a57c
The file was modifiedpySim/ts_31_102.py
Commit 0489ae67cfb62f15d70ea12ccd6fc93603fa7793 by laforge
cards.py: support ATR-based detection of sysmoISIM-SJA5

The cards are 99% software-compatible to the SJA2, so let's just
derive the SJA5 class from the SJA2

Change-Id: I706631baaf447c49904277886bc9a3f6ba3f5532
The file was modifiedpySim/cards.py
The file was modifiedpySim/sysmocom_sja2.py
Commit 69b69d4d845d6276ed28c148b96280e02798751c by laforge
docs: add SUPI/SUCI usage example

Change-Id: I2908ea9df7e78c596554731085902e2ab7278328
The file was modifieddocs/conf.py
The file was modifieddocs/shell.rst
The file was addeddocs/suci-tutorial.rst
Commit c296cb593e9bc27ab6d482b88b007db51d5eaa3f by laforge
cards: Add support for Gialer SIM cards

Change-Id: Icd2021aec630ac018f66ab565e03112047389e17
The file was modifiedpySim/cards.py
Commit bca01523dfe0105c3af7e7b1602fcfd2e45fd492 by Vadim Yanitskiy
setup.py: fix syntax errors (missing commas)

Change-Id: Ia53a659ad9652d582e2bf4a039a3e18631435072
Fixes: 2b15e315 "setup: add missing pyyaml to setup.py and README.md"
Fixes: 93aac3ab "pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable)"
The file was modifiedsetup.py
Commit d70ac226186de5503b2adc9de117d2818d307867 by laforge
modem_atcmd: raise ProtocolError instead of ReaderError on CME ERROR

Also accept ProtocolError in addition to SwMatchError in filesystem.py
when probing for applications

Change-Id: I82b50408328f8eaaee5c9e311c4620d20f930642
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/transport/modem_atcmd.py
Commit 455611c9a33099673b1807d74769597d8c1805d1 by laforge
ts_31_102: Add decoder/encoder for DF.5GS/EF.Routing_Indicator

This file is rather important for 5G SA operation, so we should have
a proper encoder/decoder in place.

Change-Id: I1b37fdfc2807976880b2cafb61951f08eebeb344
The file was modifieddocs/suci-tutorial.rst
The file was modifiedpySim/ts_31_102.py
Commit ba6d6ab64f8f7322adc251ec9ed9814f62e6c18d by laforge
ts_31_102: EF_SUPI_NAI: Decode/Encode GLI+GCI as UTF-8 strings

According to TS 23.003 Section 28.15 and 28.16 both GLI and GCI
are NAI as defined in IETF RFC 7542, which in turn specifies they
are encoded in UTF-8.

Change-Id: I0a82bd0d0a2badd7bc4a1f8de2c3e3c144ee5b12
The file was modifiedpySim/ts_31_102.py
Commit 954ce95a1648c7d81eac5c693532ea3554e5f489 by laforge
SJA2: Implement DF.SYSTEM/EF.0348_KEY using construct

This implicitly adds support for JSON->binary encoding, not just
decoding (previous code predating construct support).

Change-Id: I0994d9f66a504dd3c60b43ed5cf6645515dcbc6a
The file was modifiedpySim/sysmocom_sja2.py
The file was modifiedpySim/construct.py
Commit 557c13685e2587c80a07b4e88323d8036f7f0df8 by laforge
SJA5: Add TUAK + XOR-2G algorithm definitions for EF_[U]SIM_AUTH_KEY

Change-Id: I62a7255d991fa1ed09a7c9bcf8be4b68acfa61a7
The file was modifiedpySim/sysmocom_sja2.py
Commit 03650582e0cda9564e48bebd86049349d928d0be by laforge
SJA5: Proper encode/decode of TUAK data in EF.USIM_AUTH_KEY

Unfortunately, TUAK requires a number of additional (and
differently-sized) parameters, so the format of EF.USIM_AUTH_KEY
differs significantly depending on TUAK or non-TUAK case.

Change-Id: I0dcfe05777510fb34973dc2259b137133d8e199d
The file was modifiedpySim/sysmocom_sja2.py
Commit 219a5f369c82c5ba266e1e828bd0116fca6f714b by laforge
OTA: Fix padding of AES CMAC

When using AES CMAC for authentication of OTA messages, we must not pad
the user data before calling the CMAC function. This is unlike the DES
MAC, where padding to the DES block size is mandatory.

This bug was discovered when trying to talk OTA with AES to a
sysmoISIM-SJA5.  This patch makes the OTA AES interoperate with the
card.  Also, with this patch the cryptographic results of pySim/ota.py
are identical to those of the java code
org.opentelecoms.gsm0348.impl.crypto.CipheringManager

Change-Id: I4b40b5857f95ccb21c35795abe7a1995e368bac3
The file was modifiedpySim/ota.py
Commit d75fa3f7c90541db51127ddff97ccf6c3f03734e by laforge
Switch from pycryptodome to pycryptodomex

So for some weird historical reasons, the same python module is
available as pycryptodome (Crypto.* namespace) and pycryptodomex
(Cryptodome.* namespace).  See the following information on the project
homepage: https://www.pycryptodome.org/src/installation

To make things extra-weird, Debian choose to package pycryptodomex as
python3-pycryptodome
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886291).

So in order to support both Debian-packaged and differently-installed
packages, let's switch to pycryotodomex on all platforms/installers.

Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62
The file was modifiedpySim/utils.py
The file was modifiedpySim/ota.py
The file was modifiedREADME.md
The file was modifiedsetup.py
The file was modifiedrequirements.txt
Commit e619105249167d8f14e90f2a72ec77ea7aeb1140 by laforge
HPSIM application support

Support HPSIM as specified in 3GPP TS 31.104

Change-Id: I2729fd2b88cd13c36d7128753ad8d3e3d08a9b52
The file was modifiedpySim-shell.py
The file was addedpySim/ts_31_104.py
Commit 892526ffd0f9e8f410e54b98f40b3522ccc4af52 by laforge
pySim-shell: Unregister TS 102 222 commands during 'equip'

This avoids error messages about re-registering the same TS 102 222
commands during executing the 'equip' command.

Change-Id: I3567247fe84e928e3ef404c07eff8250ef04dfe9
The file was modifiedpySim-shell.py
Commit c85ae4188fe868dbb29cfd29baa3e96221ce6c81 by laforge
Fix result parsing of "suspend_uicc"

prior to this patch, the suspend_uicc command would always cause a
python exception as a list of integers was returned by decode_duration rather than a single integer (that can be used with %u format string).

Change-Id: I981e9d46607193176b28cb574564e6da546501ba
The file was modifiedpySim/commands.py
Commit 4e5aa304fc626879ce76deb216e53bd92ba77dc5 by pmaier@sysmocom.de
ts_31_102: fix typo

Change-Id: Ic8f93a55b974984472356f48518da91c6a521409
The file was modifiedpySim/ts_31_102.py
Commit 659781cbe1a4b43cf15d9d4971ffec3946514fa8 by laforge
Move "suspend_uicc" command from pySim-shell to ts_102_221.py

The SUSPEND UICC command is a TS 102 221 (UICC) command, so move
it to the UICC Card Profile.

Also, make sure that any shell command sets specified in the
CardProfile are actually installed during equip().

Change-Id: I574348951f06b749aeff986589186110580328bc
The file was modifiedpySim-shell.py
The file was modifieddocs/shell.rst
The file was modifiedpySim/ts_102_221.py
Commit b0e0dce80adb61aa45221a6ac45ba0e258fc4275 by laforge
ts_102221: Add "resume_uicc" command

We've had a "suspend_uicc" command since commit
ec95053249bc7f9308ca1f659d8ef6ac97a6e393 in 2021, but didn't yet
have the corresponding "resume" pair.

Note that you cannot really execute this in a reasonable way from
within pySim, as it is required to power-cycle the card
between SUSPEND and RESUME, see TS 102 221 Section 11.1.22.3.2

Change-Id: I3322fde74f680e77954e1d3e18a32ef5662759f2
The file was modifieddocs/shell.rst
The file was modifiedpySim/commands.py
The file was modifiedpySim/ts_102_221.py
Commit 1de62c41d7f98186deb346332ae08f56679bf6b8 by laforge
pySim/apdu/ts_31_102.py: Add Rel17 5G NSWO context for GET IDENTITY

Change-Id: I6ce5848ca4cf04430be7767e9cb2d18f4c5a5531
The file was modifiedpySim/apdu/ts_31_102.py
Commit 777ee9e54d9e26fe1ab507d328409e35509057f3 by laforge
Add FPLMN read and program

Change-Id: I9ce8c1af691c28ea9ed69e7b5f03f0c02d1f029b
The file was modifiedpySim-prog.py
The file was modifiedpysim-testdata/sysmoUSIM-SJS1.ok
The file was modifiedpysim-testdata/Wavemobile-SIM.ok
The file was modifiedpysim-testdata/sysmoISIM-SJA2.ok
The file was modifiedpySim-read.py
The file was modifiedpySim/cards.py
The file was modifiedpysim-testdata/Fairwaves-SIM.ok
Commit 60951b0c17c5c04e75824d671fe415f84d6b3bb8 by laforge
utils: Remove format_xplmn leading zeros in MNC

Change-Id: I803edafbd892c2b32b884d0b39fed61967a3d68b
The file was modifiedpysim-testdata/sysmoUSIM-SJS1.ok
The file was modifiedpysim-testdata/sysmoISIM-SJA2.ok
The file was modifiedpySim/utils.py
Commit 621f78c9437b315264a532eeb6d2cc0e9b50c441 by laforge
serial: return a return code in reset_card()

The method reset_card does not return a return code, while the
coresponding pcsc implementation does return 1 on success.

Change-Id: I658dd6857580652696b4a77e7d6cfe5778f09eff
The file was modifiedpySim/transport/serial.py
Commit 7ec822373ee6f14165c59fe6c997ad31d4bbf3e8 by laforge
ts_31_102: Add shell command for GET IDENTITY

GET IDENTITY is used in the "SUCI computation on USIM" feature.

Change-Id: I619d397900dbd6565f8f46acdabcee511903830c
The file was modifieddocs/shell.rst
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/commands.py
Commit 19b4a971e9405d047324922a160d0a976115c5ea by laforge
SJA5: EF.USIM_AUTH_KEY: Display / enforce proper length TUAK K

The K value in case of TUAK can be 16 or 32 bytes long.  We used to
permit/parse/display 32 bytes even if only 16 bytes was configured.

Let's enforce the correct length of "K".

Fixes: OS#6053
Change-Id: Ia0f9a2138f16dce72f3118001e95baa1c80f23ce
The file was modifiedpySim/sysmocom_sja2.py
Commit 75e31c5d5b5b20a669772f5c44e4416bfc79b5aa by laforge
test_ota: Add one first OTA SMS AES128 unit test

Change-Id: Id4a66bbfaec2d8610e8a7a2c72c0dfd08332edcd
The file was modifiedtests/test_ota.py
Commit 555cf6f6db797d62e2b5254c74c2c6016cfc0ca2 by laforge
README: rephrase initial section; add HPSIM; programmable vs. standard

Change-Id: Ied7bce9fc4ebc9a71093ac41d9c1b8e67fe04d7e
The file was modifiedREADME.md
Commit 1dce498a67bf7730c98f27e712c3323caf3ff9fe by laforge
README: remove redundancy 'Manual' and 'Documentation

Also, re-order sections oriented more towards the user (Docs first)

Change-Id: I4fc76222a1c22685131cb6926721ce24f0373046
The file was modifiedREADME.md
Commit f9a5ba5e0f107458d7dfd68ce96a1b6c0d6096ea by laforge
31.102: Fix EF.Routing_Indicator for odd number of digits

The routing indicator is BCD-encoded but has an arbitrary length of
1, 2, 3 or 4 digits.

In order to support the odd lengths of 1 or 3, we must not pad on the
byte level, but on the nibble level. This requires a slight extension of
the Rpad() Adapter.

Change-Id: I6c26dccdd570de7b7a4cd48338068e230340ec7c
Fixes: OS#6054
The file was modifiedpySim/construct.py
The file was modifiedpySim/ts_31_102.py
Commit f422eb18861906fbc544371496d38b4c95dde09f by laforge
Add ".py" suffix to sphinx-argparse generated docs

This is important to produce the right command syntax when generating
command line reference in the user manual.  However, we shouldn't add
this kludge to the individual programs, but only to the documentation
using the :prog: syntax.

Change-Id: I2ec7ab00c63d5d386f187e54755c71ffc2dce429
The file was modifiedpySim-shell.py
The file was modifieddocs/shell.rst
The file was modifieddocs/legacy.rst
The file was modifiedpySim-read.py
Commit e345e1126d9cdd248592ac0d9e4ed83500b3ca01 by laforge
pySim-shell: fix reset command

The API of the lchan object has changed. It no longer features the reset
method used by the pySim-shell reset command. Let's fix this by using
the reset method of the card object.

Change-Id: I55511d1edb97e8fa014724598ec173dd47fe25c1
The file was modifiedpySim-shell.py
Commit 7e55569f3ac20565164439c2c43c1438f29a4c3f by laforge
docs: Add section on pySim-trace to user manual

Change-Id: I5edb222818f00e36ed5b067e0f8d5786f39ae887
The file was modifieddocs/index.rst
The file was addeddocs/trace.rst
The file was modifiedpySim-trace.py
Commit 0b32725f805606ff902825ea635fa1717ee28bc0 by laforge
Add support for encoding/decoding SMS in TPDU and SMPP format

This is important when talking OTA with a SIM.

Change-Id: I0d95e62c1e7183a7851d1fe38df0f5133830cb1f
The file was modifiedrequirements.txt
The file was modifiedpySim/sms.py
The file was modifiedsetup.py
The file was addedtests/test_sms.py
Commit 721ba9b31f341c6d9219bc3cfe4de73da63beacd by laforge
tests: Add new, data-driven OTA tests

Rather than writing one test class with associated method for each
OTA algorithm / test, let's do this in a data-driven way, where new
test cases just have to provide test data, while the code iterates over
it.

Change-Id: I8789a21fa5a4793bdabd468adc9fee3b6e633c25
The file was modifiedtests/test_ota.py
Commit e126872a29b5f4919c33ee5080f461ec83bc1c47 by laforge
Fix run-editor bug with cmd2 >= 2.0.0 compatibility

In cmd2, the upstream authors decided to rename a method in 2.0.0
without providing a backwards compatibility wrapper.  Let's add that
locally.

Change-Id: Iaa17b93db13ba330551799cce5f0388c78217224
Closes: OS#6071
The file was modifiedpySim/filesystem.py
The file was modifiedpySim-shell.py
Commit 985ff31efa340ec390f00a772433635ddb341c90 by laforge
work-around what appears to be a pylint bug

smpp.pdu.pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS very much exists,
and I can prove that manually in the python shell.  So let's assume this
is a pylint bug and work around it

pySim/sms.py:72:21: E1101: Instance of 'DataCodingScheme' has no 'GSM_MESSAGE_CLASS' member (no-member)

Change-Id: Iab34bae06940fecf681af9f45b8657e9be8cbc7b
The file was modifiedpySim/sms.py
Commit 0ec01504ab894bce8dd0e2a882f21b0b253f1ee6 by laforge
cosmetic: Implement cmd2.Settable backwards-compat via wrapper class

Let's avoid too many open-coded if-clauses and simply wrap it in
a compatibility class.

Change-Id: Id234f3fa56fe7eff8e1153d71b9be8a2e88dd112
The file was modifiedpySim-shell.py
Commit 579ac3ec0eb122c83260d7509bc4e6d0cb2fe3b3 by laforge
tlv: Fix IE.from_dict() method

The existing IE.from_dict() method *supposedly* accepts a dict as
input value, but it actually expects the raw decoded value, unless it is
a nested IE.  This is inconsistent in various ways, and results in a bug
visible at a higher layer, such as files like EF.{DOMAIN,IMPI,IMPU},
which are transparent files containing a single BER-TLV IE.

Decoding such files worked, but re-encoding them did not, due to the
fact that we'd pass a dict to the from_dict method, which then gets
assigned to self.decoded and further passed along to any later actual
encoder function like to_bytes or to_tlv.  In that instance, the dict
might be handed to a self._construct which has no idea how to process
the dict, as it expects the raw decoded value.

Change-Id: I3dd5204510e5c32ef1c4a999258d87cb3f1df8c8
Closes: OS#6073
Related: OS#6072
The file was modifiedpySim/tlv.py
Commit fa9f348180ee3bb98edee38ec0209d3989ebe42e by laforge
ts_31_103: enable encode tests for files containing single TLV IE

Now that we have fixed OS#6073 in the previous commit, we can enable
the so-far disabled encoder tests for EF.{DOMAIN,IMPU,IMPI} and
remove associated FIXMEs.

Change-Id: I79bfc5b77122907d6cc2f75605f9331b5e650286
The file was modifiedpySim/ts_31_103.py
Commit f4a01472bf1a5cad38c7db1fd46666a8adfa0b96 by laforge
pySim-shell: Support USIM specific methods/commands on unknown UICC

So far, if no known programmable card (like sysmoISIM) has been found,
we were using the SimCard base class.  However, once we detect an UICC,
we should have switched to the UsimCard class, as otherwise the various
methods called by USIM/ISIM specific commands don't exist and we get
weird 'SimCard' object has no attribute 'update_ust' execptions.

The entire auto-detection and the legacy SimCard / UsimCard classes
are showing the legacy of the code base and should probably be
re-architected.  However, let's fix the apparent bug for now.

Change-Id: I5a863198084250458693f060ca10b268a58550a1
Closes: OS#6055
The file was modifiedpySim-shell.py
Commit f818acd5eb669b7d28cb770434ce2b99d3b00169 by laforge
pySim-shell: Unregister profile commands during equip

This avoids error messages about re-registering 'AddlShellCommands' commandsets during 'equip()' in the bulk_script command.

Change-Id: I893bb5ae95f5c6e4c2be2d133754e427bc92a33d
The file was modifiedpySim-shell.py
Commit 30de9fd8abc9d7c2c541fea7fa4b97c4ca1a54eb by laforge
TLV_IE_Collection: use snake-style names during from_dict()

The TLV_IE_Collection, just like the individual TLV classes, do
use their snake-style names when converting from binary to dict
using the to_dict() method.  It is inconsistent (and a bug) to
expect the CamelCase names during encoding (from_dict).  After all,
we want the output of to_dict() to be used as input to from_dict().

Change-Id: Iabd1ad98c3878659d123eef919c22ca824886f8a
The file was modifiedpySim/global_platform.py
The file was modifiedpySim/ara_m.py
The file was modifiedpySim/tlv.py
Commit ba955b650ed49e1ea9516afdc4f97cfe1442272c by laforge
pySim/tlv.py: Don't create an exception from within raise

An invalid variable used in a raise ValueError() would cause a further
exception, depriving the user of a meaningful error message.

Change-Id: I6eb31b91bd69c311f07ff259a424edc58b57529a
The file was modifiedpySim/tlv.py
Commit 2352f2dcdd4782d11a7dac308d29d77864592f39 by laforge
pySim/tlv.py: Fix TLV_IE_Collection from_dict with nested collections

This is all quite complicated.  In general, the TLV_IE.to_dict() method
obviously is expected to return a dict (with key equal to the snake-case
name of the class, value to the decode IE value).  This single-entry
dict can then be passed back to the from_dict() method to build the
binary representation.

However, with a TLV_IE_Collection, any TLV_IE can occur any number of
times, so we need an array to represent it (dict would need unique key,
which doesn't exist in multiple instances of same TLV IE).  Hence, the
TLV_IE_Collection.to_dict() method actually returns a list of dicts,
rather than a dict itself.  Each dict in the list represents one TLV_IE.

When encoding such a TLV_IE_Collection back from the list-of-dicts, we
so far didn't handle this special case and tried to de-serialize with
a class-name-keyed dict, which doesn't work.

This patch fixes a regression in the aram_store_ref_ar_do pySim-shell
command which got introduced in Change-Id I3dd5204510e5c32ef1c4a999258d87cb3f1df8c8

While we're fixing it, add some additional comments to why things are
how they are.

Change-Id: Ibdd30cf1652c864f167b1b655b49a87941e15fd5
The file was modifiedpySim/tlv.py
Commit f5e26ae95430a04db4749b6b2fb63d8e555aa6ba by laforge
pySim/utils: define 'Hexstr' using NewType

This means Hexstr is no longer an alias for 'str', but a distinct
new type, a sub-class of 'str'.

Change-Id: Ifb787670ed0e149ae6fcd0e6c0626ddc68880068
The file was modifiedpySim/utils.py
Commit ab6897c4cd7f5e0c019f69b2e10ce552bde12127 by laforge
pySim/transport: More type annotations

Change-Id: I62e081271e3a579851a588a4ed7282017e56f852
The file was modifiedpySim/utils.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/__init__.py
Commit fdb187d7fffd3d2301f3a1b2a9ab4a0dad0e5d73 by laforge
pySim/commands.py: Better type annotations

Change-Id: I68081b5472188f80a964ca48d5ec1f03adc70c4a
The file was modifiedpySim/commands.py
The file was modifiedpySim/utils.py
Commit f9f8d7a2942bf6561f813acdc50b6f87bb262f69 by laforge
pySim/transport: Use newly-defined ResTuple type

Let's use the newly-added ResTuple type annotation rather than
open-coding it everywhere.

Change-Id: I122589e8aec4bf66dc2e86d7602ebecb771dcb93
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/pcsc.py
Commit a1561fe9aeb96110432440f43d95a48606848481 by laforge
ts_102_222: Remove unneeded imports

Change-Id: I0fc54a042f03ecf707fde81a859c7dd65a7009cc
The file was modifiedpySim/ts_102_222.py
Commit fdcf3c570248a43fd9f773a7189dfbb450a4fe7a by laforge
GlobalPlatform ADF.SD: Add command line reference + error message

The get_data shell command didn't have any interactive help / syntax,
and no meaningful error message in case an unknown data object name
was specified by the user.  Let's fix that.

Change-Id: I09faaf5d45118635cf832c8c513033aede1427e5
The file was modifiedpySim/global_platform.py
The file was modifieddocs/shell.rst
Commit 284efda086ee1f590c488310f307ad9d8314e3a4 by laforge
pySim-prog: Also accept 18-digit ICCIDs

There are cards with 18-digit ICCIDs, so let's be a bit more tolerant.

Change-Id: I5395daeb2e96987335f6f9bf540c28d516001394
The file was modifiedpySim-prog.py
Commit 02a7f7441fb1455c0d143ec6bd4a54fff9fe65bc by laforge
filesystem: Support selecting MF from MF

This was currently not handled in build_select_path_to(), resulting in
weird exceptions like 'Cannot determine path from MF(3f00) to MF(3f00)'

Change-Id: I41b9f047ee5dc6b91b487f370f011af994aaca04
The file was modifiedpySim/filesystem.py
Commit 263fb0871c0c8b6b3cb58eaa1ca1779ce1adf6c4 by laforge
pySim/cards: Split legacy classes away from core SIM + UICC

This introduces an internal split between
* the code that is shared between pySim-shell and legacy tools, which is
  now in the new class hierarchy {Card,SimCard,UiccCard}Base
* the code that is only used by legacy tools,
  which is using the old class names inherited from the *Base above

All users still go through the legacy {Sim,Usim,Isim}Card classes, they
will be adjusted in subsequent patches.

Change-Id: Id36140675def5fc44eedce81fc7b09e0adc527e1
The file was modifiedpysim-testdata/sysmosim-gr1.ok
The file was modifiedpySim/cards.py
The file was modifiedpysim-testdata/fakemagicsim.ok
Commit f8d2e2ba089221d39c52593908aa15df4b6e73d5 by laforge
split pySim/legacy/{cards,utils} from pySim/{cards,utils}

There are some functions / classes which are only needed by the legacy
tools pySim-{read,prog}, bypassing our modern per-file transcoder
classes.  Let's move this code to the pySim/legacy sub-directory,
rendering pySim.legacy.* module names.

The long-term goal is to get rid of those and have all code use the
modern pySim/filesystem classes for reading/decoding/encoding/writing
any kind of data on cards.

Change-Id: Ia8cf831929730c48f90679a83d69049475cc5077
The file was modifiedpySim-trace.py
The file was addedpySim/legacy/cards.py
The file was addedpySim/legacy/__init__.py
The file was modifiedpySim/utils.py
The file was modifiedtests/test_utils.py
The file was addedpySim/legacy/utils.py
The file was modifiedpySim/cards.py
The file was modifiedpySim-prog.py
The file was modifiedpySim-read.py
The file was modifiedpySim-shell.py
The file was modifiedsetup.py
Commit a3961298efeba7d65d861280be1ea642fbe47fc3 by laforge
pySim/cards: Add type annotations

Change-Id: Id5752a64b59097584301c860ebf74d858ed3d240
The file was modifiedpySim/cards.py
Commit 57ad38e661453dcc89648039c54dcfad7cf4c8ea by laforge
create pySim.legacy.ts_51_011.py and move legacy code there

Those old flat dicts indicating FID to string-name mapping have long
been obsoleted by the pySim.filsystem based classes.

Change-Id: I20ceea3fdb02ee70d8c8889c078b2e5a0f17c83b
The file was modifiedpySim/legacy/cards.py
The file was addedpySim/legacy/ts_51_011.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim-prog.py
The file was modifiedpySim-read.py
Commit b314b9be3480fa0b226ef2601e005840ac4e68b4 by laforge
ts_31_102, ts_31_103: Move legacy-only code to pySim.legacy

Change-Id: Ifebfbbc00ef0d01cafd6f058a32d243d3696e97e
The file was modifiedpySim-read.py
The file was addedpySim/legacy/ts_31_102.py
The file was modifiedpySim/ts_31_102.py
The file was addedpySim/legacy/ts_31_103.py
The file was modifiedpySim/ts_31_103.py
The file was modifiedpySim/legacy/cards.py
Commit 172c28eba812f62cfff5c168f438a7cfd45308c0 by laforge
cards: All derived of SimCardBase use CLA=A0; all UiccCardBase use CLA=00

Change-Id: Id61b549f68410631529349ee62b08a102f609405
The file was modifiedpySim/cards.py
The file was modifiedpySim/legacy/cards.py
Commit 775ab01a2b20fd797460b4358347fd90252785bd by laforge
cards: cosmetic rename, argument name should be scc, not ssc

ssc = SimCardCommands

Change-Id: I9d690a0a5b9b49ea342728a29b7d4ed10ac31e4e
The file was modifiedpySim/cards.py
Commit 659d7c11caddb827cdfb8b41ee630a3b3fce8f84 by laforge
cards: all UICC should use sel_ctrl="0400" and SIM "0000"

Hence move this from the derived classes into the respective base
classes SimCardBase and UiccCardBase

Change-Id: Iad197c2b560c5ea05c54a122144361de5742aafd
The file was modifiedpySim/legacy/cards.py
The file was modifiedpySim/cards.py
Commit f9e2df129605033c5ae3e365d87daed547b5b336 by laforge
cdma_ruim: Fix unit tests and actually enable them

As pySim.cdma_ruim was not imported by test_files.py, the unit tests
were apparently never executed and hence didn't pass.  Let's fix both
of those problems.

Change-Id: Icdf4621eb68d05a4948ae9efeb81a007d48e1bb7
The file was modifiedtests/test_files.py
The file was modifiedpySim/cdma_ruim.py
Commit 323a35043f360080f7e100dbb9f16929f685371d by laforge
Introduce concept of CardProfileAddon

We have a strict "one CardProfile per card" rule.  For a modern UICC
without legacy SIM support, that works great, as all applications
have AID and ADF and can hence be enumerated/detected that way.

However, in reality there are mostly UICC that have legacy SIM, GSM-R
or even CDMA support, all of which are not proper UICC applications
for historical reasons.

So instead of having hard-coded hacks in various places, let's introduce
the new concept of a CardProfileAddon.  Every profile can have any
number of those.  When building up the RuntimeState, we iterate over the
CardProfile addons, and probe which of those are actually on the card.
For those discovered, we add their files to the filesystem hierarchy.

Change-Id: I5866590b6d48f85eb889c9b1b8ab27936d2378b9
The file was modifiedpySim-shell.py
The file was modifiedpySim-trace.py
The file was modifiedpySim/cdma_ruim.py
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/gsm_r.py
The file was modifiedpySim/profile.py
Commit 2d5959bf47d82e8f394a0ccb54a1e1d8e89456fa by laforge
ts_102_221: Remove CardProfileUICCSIM

This profile has always been a hack/work-around for the situation that
a classic GSM SIM is not a UICC, and we didn't yet have the concept of
CardProfileAddons yet, so there was no way to probe and add something
to an UICC which was not an application with its own AID/ADF.

Since now we have CardProfileAddons (including one for GSM SIM),
and pySim-trace (the other user of CardProfileUICCSIM) has also switched
over to using CardProfileUICC + addons, we can remove this work-around.

Change-Id: I45cec68d72f2003123da4c3f86ed6a5a90988bd8
The file was modifiedpySim/ts_102_221.py
Commit 6ad9a247ef54245b12cc8695a9f8298cb25bb8d4 by laforge
pySim-shell: Iterate over CardApplication sub-classes

Rather than having to know and explicitly list every CardApplication,
let's iterate over the __subclasses__ of the CardApplication base class.

Change-Id: Ia6918e49d73d80acfaf09506e604d4929d37f1b6
The file was modifiedpySim-shell.py
Commit b77063b9b724235ceae06a0ac2d1d022ca11dbf2 by laforge
pySim/filesystem.py: remove unused class FileData

Change-Id: I62eb446e4995a532227a45c8cc521f5f80535d93
The file was modifiedpySim/filesystem.py
Commit 531894d386af1ba05aa5a98449727a897404936e by laforge
move Runtime{State,Lchan} from pySim.filesystem to new pySim.runtime

Those two are really separate concepts, so let's keep them in separate
source code files.

Change-Id: I9ec54304dd8f4a4cba9487054a8eb8d265c2d340
The file was modifiedpySim-shell.py
The file was modifiedpySim-trace.py
The file was modifiedpySim/sysmocom_sja2.py
The file was addedpySim/runtime.py
The file was modifiedpySim/apdu/ts_102_221.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/apdu/__init__.py
Commit 38306dfc047c5dabcd4995ce82f1c15099c830de by laforge
pySim-shell: Add a mode where a pySim-shell cmd can be passed by shell

This adds a new operation mode for pySim-shell, where a single command
can be passed to pySim-shell, which then is executed before pySim-shell
terminates.

Example: ./pySim-shell.py -p0 export --json

Change-Id: I0ed379b23a4b1126006fd8f9e7ba2ba07fb01ada
Closes: OS#6088
The file was modifiedpySim-shell.py
Commit 3175d61eb2746cb7c23f08cc3a6b3031bf5d2413 by pmaier@sysmocom.de
cards: fix swapped PIN mapping number

The constant for _adm_chv_num is swapped. It should be 0x0A, rather than
0xA0

Change-Id: I5680d2deee855ef316a98058e8c8ff8cf4edbbb2
The file was modifiedpySim/cards.py
Commit cfb665bb3f958a7cb219dbb06ecdbef4b060ee99 by pmaier@sysmocom.de
pySim-shell: fix verify_adm command

The comman verify_adm does no longer work since the verify_adm method is
no longer available in the card base classes (cards.py). Let's use the
verify_chv method from SimCardCommands instead.

Change-Id: Ic87e1bff221b10d33d36da32b589e2737f6ca9cd
The file was modifiedpySim-shell.py
Commit 7d86fe1d8aed6f4aafb0b450b8e28b2e7cc3949e by laforge
apdu/ts_102_221: extract channel number from dict before calling del_lchan

When the method del_lchan is called, closed_channel_nr still contains a dict
that contains the channel number under the key 'logical_channel_number'.
This will lead to an exception. We must extact the channel number from
the dict before we can use it with del_lchan. (See also
created_channel_nr)

Related: OS#6094
Change-Id: I399856bc227f17b66cdb4158a69a35d50ba222a7
The file was modifiedpySim/apdu/ts_102_221.py
Commit 92b9356ed2639068dfb552ea25f79a8e50037393 by pmaier@sysmocom.de
runtime: fix lchan deletion in method reset

When we perform a reset while multiple channels are open (this is in
particular the case when parsing real world traces with pySim-trace). To
delete those channels during the reset we iterate over the dictionary
using the keys and delete the channels one by one. However, this must
not be done using the keys as index directly. Python will then throw an
exception: "RuntimeError: dictionary changed size during iteration".

Instead using the keys directly we should cast them into a list and then
using that list for the iteration.

Related: OS#6094
Change-Id: I430ef216cf847ffbde2809f492ee9ed9030343b6
The file was modifiedpySim/runtime.py
Commit fec721fcb192dc18d85b618a48bc62e4f4c1d31c by laforge
Fixed `mnc` encoding

According to 3GPP TS 24.008 section 10.5.5.36 PLMN identity of the CN operator

Change-Id: I400435abfa8b67da886fc39c801e1abba39725bf
The file was modifiedpySim/utils.py
Commit 791f80a44f8110f478a632cd2bcde5944ad4bd96 by pmaier@sysmocom.de
construct: add adapter Utf8Adapter to safely interpret utf8 text

Uninitialized Files, File records or fields in a File record or File
usually contain a string of 0xff bytes. This becomes a problem when the
content is normally encoded/decoded as utf8 since by the construct
parser. The parser will throw an expection when it tries to decode the
0xff string as utf8. This is especially a serious problem in pySim-trace
where an execption stops the parser.

Let's fix this by interpreting a string of 0xff as an empty string.

Related: OS#6094
Change-Id: Id114096ccb8b7ff8fcc91e1ef3002526afa09cb7
The file was modifiedpySim/ts_31_103.py
The file was modifiedpySim/construct.py
The file was modifiedpySim/ts_31_102.py
Commit 407c95520fd37d5e969eb34edc1f6272509138cd by pmaier@sysmocom.de
pySim-trace: add commandline option --show-raw-apdu

The trace log currently only shows the parsed APDU. However, depending
on the problem to investigate it may be required to see the raw APDU
string as well. Let's add an option for this.

Related: OS#6094
Change-Id: I1a3bc54c459e45ed3154479759ceecdc26db9d37
The file was modifiedpySim-trace.py
Commit 784b947b117e8c21ed97f8fe4edc55e77cf72fc6 by pmaier@sysmocom.de
pySim-trace: remove stray debug print

Related: OS#6094
Change-Id: I5f030a8552a84f721bd12ab4751933fc6eeae256
The file was modifiedpySim-trace.py
Commit 1f46f07e3c1d793ca334520786fad4ec90e83916 by pmaier@sysmocom.de
utils: tolerate uninitialized fields in dec_addr_tlv

TLV fields holding an address may still be uninitialized and hence
filled with 0xff bytes. Lets interpret those fields in the same way as
we interpret empty fields.

Related: OS#6094
Change-Id: Idc0a92ea88756266381c8da2ad62de061a8ea7a1
The file was modifiedpySim/utils.py
Commit 162ba3af3e08ae4396880629b0686b4e7bc3aa55 by pmaier@sysmocom.de
pySim-trace: mark card reset in the trace

The trace log currently does not contain any information about card
resets. This makes the trace difficult to follow. Let's use the
CardReset object to display the ATR in the trace.

Related: OS#6094
Change-Id: Ia550a8bd2f45d2ad622cb2ac2a2905397db76bce
The file was modifiedpySim-trace.py
The file was modifiedpySim/apdu/__init__.py
The file was modifiedpySim/apdu_source/pyshark_gsmtap.py
The file was modifiedpySim/apdu_source/gsmtap.py
The file was modifiedpySim/apdu_source/pyshark_rspro.py
Commit 8dc2ca2d376f56a16df589a5ddc6ead82bfdfb58 by pmaier@sysmocom.de
pySim-trace: catch StopIteration exception on trace file end

When the trace file end is reaced, pyShark raises a StopIteration
exception. Let's catch this exception and exit gracefully.

Related: OS#6094
Change-Id: I6ab5689b909333531d08bf46e5dfea59b161a79e
The file was modifiedpySim-trace.py
Commit 6c5c3f8b2b49a56b6204be83ded918bec0c5826f by laforge
Reimplement ust_service_activate and ust_service_deactivate for USIM/EF.UST

Fixes: f8d2e2ba0892 ("split pySim/legacy/{cards,utils} from pySim/{cards,utils}")
Change-Id: I7a6a77b872a6f5d8c478ca75dcff8ea067b8203e
The file was modifiedpySim/ts_31_102_telecom.py
The file was modifiedpySim/ts_31_102.py
Commit 760e421be5e1b40457c07e4c6e21439bf813b3b5 by laforge
utils.py: remove superfluous import from itself

b2h() is already available.

Change-Id: Ied513a08cc8b5091dd467106250f1e6b5067c3a8
The file was modifiedpySim/utils.py
Commit 2dd59edd7412aed313e4b2c29cab4faf8d1bbfbc by laforge
ARA-M: fix encoding of the PkgRefDO when using aram_store_ref_ar_do

The command wasn't used the correct dict to allow the encoders to work.

Related: OS#6121
Change-Id: Ic2bc179b413a6b139e07e3e55b93ff921cb020a9
The file was modifiedpySim/ara_m.py
Commit c8facea845607073376c9c385943fcc360fae317 by laforge
Fix the remaining functions using the broken Card.update_ust() call

Card.update_ust() got replaced by the file operation ust_update().
In addition to Change-Id I7a6a77b872a6f5d8c478ca75dcff8ea067b8203e

Fixes: f8d2e2ba0892 ("split pySim/legacy/{cards,utils} from pySim/{cards,utils}")
Change-Id: Ie6405cae37493a2101e5089a8d11766fbfed4518
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/ts_31_103.py
Commit ec9cdb73e7584a7936b17963a0acc30fe384855a by laforge
tests: add test script for pySim-trace

pySim-trace has no test coverage yet. Let's use a script to run a
GSAMTAP pcacp through it and check that no exceptions are raised.

Related: OS#6094
Change-Id: Icfabfa7c59968021eef0399991bd05b92467d8d2
The file was addedpysim-testdata/pySim-trace_test_gsmtap.pcapng
The file was modifiedcontrib/jenkins.sh
The file was addedtests/pySim-trace_test.sh
Commit 1cdcbe4f57ac13e3f5f271fea363c160f78ab985 by laforge
pysim-test: rename pysim-test.sh to pySim-prog_test.sh

We now have pySim-shell and pySim-trace. Let's give pysim-test.sh a more
distinctive name so that it is clear to which program it refers.

Related: OS#6094
Change-Id: I438f63f9580ebd3c7cc78cc5dab13c9937ac6e3a
The file was removedtests/pysim-test.sh
The file was modifiedcontrib/jenkins.sh
The file was addedtests/pySim-prog_test.sh
Commit 600e284a7b05e0ff322a86b8043662323aa58d7a by laforge
README.md: Add note about pySim-trace.py dependencies

Related: OS#6094
Change-Id: I2e03f9c827bd6ee73891bba34bd2f2efe3ded7e6
The file was modifiedREADME.md
Commit d62182ca437b5434f765e89c31c0bd1bfc68a6b6 by pmaier@sysmocom.de
runtime: make sure applications are always listed in the same order

When we print the profile applications. which are not registered in
EF.DIR, we use python sets to subtract the applications which were part
of EF.DIR and hence already listed. Since we use sets the order may be
arbitrary. This is so far not a problem, since the output is meant to be
read by humans, but as soon as we try to use the output for unit-test
verifications we need a consistent order (sorted)

Related: OS#6094
Change-Id: Ie75613910aaba14c27420c52b6596ab080588273
The file was modifiedpySim/runtime.py
Commit 7124ad103106fc822bab1174e396a3c4e9c2f3e2 by pmaier@sysmocom.de
pySim-trace_test: fix shebang line

Related: OS#6094
Change-Id: Ib2d3a4659f5db9772ddcd9a4ae73c04fec1070fc
The file was modifiedtests/pySim-trace_test.sh
Commit a380e4efbea2701da677dc6a31065dda9bcb208f by pmaier@sysmocom.de
pySim-trace_test: verify output of pySim-trace.py

At the moment we only verify that no exceptions occurred but the output
is not yet verfied.

Related: OS#6094
Change-Id: I3aaa779b5bd8f30936c284a80dbdcb2b0e06985c
The file was addedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
The file was modifiedtests/pySim-trace_test.sh
Commit 63e8a188832e490176972de9bea41e8a6abddeb7 by pmaier@sysmocom.de
pySim-prog_test: fix typo

Related: OS#6094
Change-Id: I6432ee3ee948fea697067fb3857cb9b83b1f8422
The file was modifiedtests/pySim-prog_test.sh
Commit e6cba76a36237064086d746dbb822e2c42855758 by pmaier@sysmocom.de
pySim-shell: check presence of runtime state before accessing it

When the command equip (do_equip) is executed, it accesses
self.rs.profile to see if there are any commands that need to be
unregistered before moving on with the card initialization.

However, it may be the case that no runtime state exists at this point.
This is in particular the case when the card is completely empty and
hence no profile is picked and no runtime state exists.

Change-Id: I0a8be66a69b630f1f2898b62dc752a8eb5275301
The file was modifiedpySim-shell.py
Commit 83222abf2e03f7bc36cb950e736aa34541f46143 by flokli
setup.py: fix package name

The package providing the serial python module seems to be called
pyserial, which also matches what's written in requirements.txt.

Change-Id: I71ef6a19a487101e552219f10f2fa6215b966abd
The file was modifiedsetup.py
Commit 09ff0e2b433b7143d5b40b4494744569b805e554 by flokli
README.md: sort dependencies, document smpp.pdu

This dependency is currently only mentioned in requirements.txt, it
makes sense to also document it here.

Change-Id: I89760dd4008829c91fafbd442483d076c92a7ed4
The file was modifiedREADME.md
Commit a42ee6f99d1cb1e8b3f4c58379291224c0ce4309 by laforge
cards: get rid of method read_iccid

The method read_iccid in class CardBase should be put back to
legacy/cards.py. The reason for this is that it falls in the same
category like read_imsi, read_ki, etc. We should not use those old
methods in future programs since we have a more modern infrastructure
(lchan) now.

Also pySim-shell.py is the only caller of this method now. It is not
used in any other place.

Related: RT#67094
Change-Id: Ied3ae6fd107992abcc1b5ea3edb0eb4bdcd2f892
The file was modifiedpySim/cards.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/legacy/cards.py
Commit 71a3fb8b3a38cd70946468a072e9fe9895d73927 by laforge
sim-rest-server: do not select ADF.USIM in connect_to_card

When the function connect_to_card is done, it selects ADF.USIM. This
might be contraproductive in case someone needs to access files on MF
level in one of the REST methods. Instead fo ADF.USIM, let's use MF as a
common ground to start from.

At the moment the only existing REST (info, auth) immediately select
ADF.USIM after calling connect_to_card already, so there are no further
modifications necessary.

Related: RT#67094
Change-Id: I16e7f3c991c83f81989ecc4e4764bb6cc799c01d
The file was modifiedcontrib/sim-rest-server.py
Commit 91b379a039b97fe105ced17ffc7dd1770ae58641 by laforge
sim-rest-server: use UiccCardBase instead of UsimCard

The class UsimCard is deprecated and only still used in very old
legacy applications. let's use the more modern UiccCardBase class
instead.

Related: RT#67094
Change-Id: I3676f033833665751c0d953176eafe175b20c14a
The file was modifiedcontrib/sim-rest-server.py
Commit 7d13845285ccdd2f8a310c19bdbeb685fd1a205e by pmaier@sysmocom.de
sim-rest-server: fix REST method info

The REST megthd info uses deprecated methods to read the ICCID and the
IMSI from the card. However, we can replace those methods by selecting
the files we are interested in manually and then reading them.

Related: RT#67094
Change-Id: Ib0178823abb18187404249cfed71cfb3123d1d74
The file was modifiedcontrib/sim-rest-server.py
Commit 3a37ad015c3fab6d2e34a08e16a1d6197f8bdfba by pmaier@sysmocom.de
sim-reset-server: fix error printing sw_match_error

In the last line of the if,elif,else branch, when we print the ApiError
object, we pass the variable sw to str() instead passing it to
ApiError() like we do it in the lines above. This is not correct and
causes strange exceptions.

Related: OS#67094
Change-Id: I5a1d19abeb00c2c9dc26517abc44a5c916f2d658
The file was modifiedcontrib/sim-rest-server.py
Commit 4840d4dc8f887a7193fbd71cea4619b06a02f91c by pmaier@sysmocom.de
pySim-shell: fix commandline option -a (verify_adm)

The commandline option -a, which does an ADM verification on startup,
does no longer work since the verify_adm method is no longer available
in the card base classes (cards.py). Let's use the verify_chv method
from SimCardCommands instead.

Related: RT#68294
Change-Id: Ic1e54d0e9e722d64b3fbeb044134044d47946f7c
The file was modifiedpySim-shell.py
Commit 0ac4d3c7dcaa4f1fdfa632c93e6af2bafbd7501d by pmaier@sysmocom.de
commands: make method verify_binary and verify_record private

The methods verify_binary and verify_record are only used internally
in class SimCardCommands, they can be both private methods. Also lets
move them above the method that uses them.

Related: OS#5714
Change-Id: I57c9af3d6ff45caa4378c400643b4ae1fa42ecac
The file was modifiedpySim/commands.py
Commit 37e57e0c45320fe3b855e3ec57ab52145c8b2987 by pmaier@sysmocom.de
filesystem: add attribute "leftpad" to class LinFixedEF

In some cases, the specs do not specify an absolute record length.
Instead there may be only a minimum record length specified. The card
vendor may then chose to use larger record length at will. This usually
is no problem since the data is usually written from the left and the
remaining bytes are padded at the end (right side) of the data. However
in some rare cases (EF.MSISDN, see also 3GPP TS 51.011, section 10.5.5)
the data must be written right-aligned towards the physical record
length. This means that the data is padded from the left in this case.

To fix this: Let's add a "leftpad" flag to LinFixedEF, which we set to
true in those corner cases. The code that updates the record in
commands.py must then check this flag and padd the data accordingly.

Change-Id: I241d9fd656f9064a3ebb4e8e01a52b6b030f9923
Related: OS#5714
The file was modifiedpySim/runtime.py
The file was modifiedpySim/commands.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/filesystem.py
Commit 91c971bf82648ef5073589aa50fac9d9cec9aa82 by pmaier@sysmocom.de
pySim-prog, pySim-shell do not use global variables

When __main__ runs different variables get assigned. In particular opts,
scc, sl and ch. Those variables are available in any scope and
technically it is possible to access them. However, lets not do this
since it leads to confusion. Also, pylint will complain about those code
locations.

In pySim-shell.py
- Let's use the proper locations (sl and ch are stored in PysimApp.
- Scc can be assigned in init_card.
- In method walk, the use of the variable opts to call ection_df is wrong,
  lets use **kwargs (see also usage of action_ef).
- The constructor of Cmd2ApduTracer has a parameter cmd2_app, but usese
  the global variable app. Let's use cmd2_app instead.

In pySim-prog.py
- Do not use opts.num in find_row_in_csv_file, use num instead.
- Pass scc to process_card as parameter so that it won't access scc
  in the global scope.

Change-Id: I7f09e9a6a6bfc658de75e86f7383ce73726f6666
Related: OS#6210
The file was modifiedpySim-prog.py
The file was modifiedpySim-shell.py
Commit 8e03f2f2ed83497bc06443b6bd065547bd2f8209 by pmaier@sysmocom.de
pySim-shell: do not pass failed card object to PysimApp

When the try block in which we also call init_card() fails, there may be
no card object, so we must not pass the card object to PysimApp in the
except block. This is also no problem, PysimApp will run without the
card object until the user executes do_equip for a second attempt.

Related: OS#6210
Change-Id: I28195f442ce007f05f7610c882bbc4a6520a8ce6
The file was modifiedpySim-shell.py
Commit 6bfa8a853335e5bd75fb1f40b3ad3df95583f316 by pmaier@sysmocom.de
pySim-shell: print device info in case an exception occurs

When an exception occurs while initializing or handling the card we
print a traceback, but we do not print any info that allows us to
identify the device that was involved when the exception occurred. Let's
include the device path or number in the error message before we print
the traceback.

In order to make it easier to print the device information, let's add a
__str__() method to all of our devices. This method shall return the
device number or path.

Related: OS#6210
Change-Id: I200463e692245da40ea6d5b609bfc0ca02d15bdb
The file was modifiedpySim-trace.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/transport/modem_atcmd.py
Commit 58e89eb15a9260104c03d4285920c1d190fc9b80 by pmaier@sysmocom.de
transport: add return type annotation to method __str__

The abstract class LinkBase has no return type annotation on its
__str__ method.

Related: OS#6210
Change-Id: I26d3d2714708dbe957704b60d17ba2afa325b2c4
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/modem_atcmd.py
Commit af4e5bb18cdf498af481e07c6aff2d65ef60630e by pmaier@sysmocom.de
transport: do not catch exceptions in init_reader

We currently catch any exceptions that may occur when the card reader is
initialized. Then we print the exception string or the exception type
when no string is available. However, a failure during the reader
initialization is usually a severe problem, so a traceback would provde
a lot of helpful information to debug the issue. So lets not catch any
exceptions at this level so that we get the full backtrace.

Related: OS#6210
Change-Id: I4c4807576fe63cf71a7d33b243a3f8fea0b7ff23
The file was modifiedpySim-read.py
The file was modifiedpySim-prog.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim-shell.py
Commit 28accc88c3fe8f110e31cadd895bb7fc71e0e226 by laforge
ts_31_102: Fix initialization of file size

We were using positional arguments when instantiating instances
of classes like EF_5GS3GPPLOCI with non-default names/fids/...

However, we got the argument order wrong and were passing the
description string in the position of the file size, which causes
exceptions like the following from pySim-trace:

Traceback (most recent call last):
  File "/home/laforge/projects/git/pysim/./pySim-trace.py", line 198, in <module>
    tracer.main()
  File "/home/laforge/projects/git/pysim/./pySim-trace.py", line 125, in main
    inst.process(self.rs)
  File "/home/laforge/projects/git/pysim/pySim/apdu/__init__.py", line 259, in process
    self.processed = method(self.lchan)
  File "/home/laforge/projects/git/pysim/pySim/apdu/ts_102_221.py", line 152, in process_on_lchan
    if self.cmd_dict['offset'] != 0 or self.lr < self.file.size[0]:
TypeError: '<' not supported between instances of 'int' and 'str'

Let's use named initializers for any arguments after the usual "fid, sfid, name"
initial arguments.

Change-Id: I7f32c9fd01094620b68b0e54536ecc6cdbe67903
The file was modifiedpySim/ts_31_102.py
Commit 509ecf84fa4d9e7d6806ad200bbfac9d12a01555 by laforge
Use keyword argument for file description argument

While our base classes (TransparentEF / LinFixedEF) always have the
dsecription as 4th argument after "fid, sfid, name", most of the derived
file-specific classes do not share that same argument order.

As seen in the bug fixed by previous Change-Id I7f32c9fd01094620b68b0e54536ecc6cdbe67903
this can have serious consequences.  Let's avoid using unnamed
(positional) arguments for the description text altogether.

Change-Id: Icfb3fd1bae038c54fa14a91aa9f75219d839968c
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/ts_51_011.py
Commit 7c0cd0a93b87e1ee52ce6bccdb3a2a7ff3ee7be0 by laforge
pySim-shell: do not fail when EF.ICCID does not exist

An eUICC that has no active eSIM profile does not have an ICCID. (The
reason for this is that EF.ICCID is part of the eSIM profile).
Unfortunately pySim-shell insists on reading the ICCID from EF.ICCID on
startup in order to use it as a lookup key for verify_adm later.

To solve the problem, let's add a try/except block around the section
where EF.ICCID is read. In case of failure we set the ICCID to None,

Related: OS#5636
Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
The file was modifiedpySim-shell.py
Commit 79972522677a31258bfe91935a1cd52713edebea by laforge
cards.py: Fix type annotation

The CardBaes 'scc' member refers to a SimCardCommands instance,
not to a LinkBase.

Change-Id: If4c0dfbd8c9a03d1a0bc4129bb3c5d5fa492d4cb
The file was modifiedpySim/cards.py
Commit bdf595756ec344cad9db619bff578466c338b855 by laforge
pySim-shell: Create/delete RuntimeLchan objects on open/close of channel

We already have the open channel and close_channel commands in
pySim-shell. They are sent to the card and acknowledged, respectively.

We also already do have code that can track multiple different logical
channels (the rs.lchan array).  However, this is currently only used by
pySim-trace, and not by pySim-shell.  Let's change that.

Change-Id: Idacee2dc57e8afe85c79bc85b259064e7f5b83a2
Related: OS#6230
The file was modifiedpySim-shell.py
Commit 49acc06327b5462674ab05c65d7b42980dc0aedd by laforge
RuntimeState: Add type annotation for 'card' argument

Change-Id: I3c5138a918f7e45aabe3972883714d05ee704877
The file was modifiedpySim/runtime.py
Commit 91eeecfbf31d407b46874faf44cd96f4562581fd by laforge
docs: Fix command reference for 'apdu' command

This fixes the below error during build of the documentation:

pysim/docs/shell.rst:349: ERROR: "<class 'pySim-shell.PySimCommands'>" has no attribute "apdu_cmd_parser"

Change-Id: If89b66a45ea18b5a3fc56bf77b05e679463da5a8
The file was modifieddocs/shell.rst
Commit 3dfab9dede002769c1c7a3f04e3a28c653bd8c72 by laforge
commands.py: Add support for multiple logical channels.

Historically we always only had one instance of SimCardCommands, but
with this patch we can now have multiple instances, one for each lchan.

The SimCardCommands class is aware of the logical channel it runs on
and will patch the CLA byte accordingly.

Change-Id: Ibe5650dedc0f7681acf82018a86f83377ba81d30
Related: OS#6230
The file was modifiedpySim/commands.py
Commit 46255121e0fc5a6cffddc24c992e0dd6b24da425 by laforge
pySim-shell: Create + use per-RuntimeLchan SimCardCommands

This new approach will "fork" separate SimCardCommands instances
for each RuntimeLchan.  Higher-layer code should now always use the
RuntimeLchan.scc rather than the RuntimeState.card._scc in order to
make sure commands use the correct logical channel.

Change-Id: I13e2e871f2afc2460d9fd1cd566de42267c7d389
Related: OS#6230
The file was modifiedpySim/global_platform.py
The file was modifiedpySim/commands.py
The file was modifiedpySim/ts_102_222.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/runtime.py
The file was modifiedpySim/ara_m.py
The file was modifiedpySim/ts_51_011.py
Commit 6dd6f3e12ca1109bcc0de60aa273594dda7c7510 by laforge
prevent SimCardCommands.select_adf_by_aid bypassing lchan

Now that pySim-shell is aware of logical channels and issues almost
all of its APDUs on the currently selected channel, we must also make
sure that ADF selection by AID (implemented by the CardBase class)
issues the SELECT on the respective logical channel.

Before this patch, SELECT ADF by AID would always be issued on the
primary logical channel (0), irrespective of the currently active
RuntimeLchan.

Change-Id: Idf05c297e6a2e24ca539408b8912e348c0782bb4
Related: OS#6230
The file was modifiedpySim/cards.py
The file was modifiedpySim/runtime.py
Commit 20650997e8f7652957b83116c16df7f3b180f3b4 by laforge
pySim-shell: Add 'switch_channel' command

We've already had the 'open_channel' and 'close_channel' commands,
which were sent to (and acknowledged by) the card.  However,
those commands didn't affect the pySim-shell state, i.e. all
communication would still happen through the default channel '0'.

With this patch we introduce a 'switch_channel' command, using which
the user can determine which of the (previously opened) logical channels
shall be used by pySim-shell.

Change-Id: Ia76eb45c4925882ae6866e50b64d9610bd4d546d
Closes: OS#6230
The file was modifieddocs/shell.rst
The file was modifiedpySim-shell.py
Commit 237ddb5bb39eef5acfc80bda35875e7ce270f243 by laforge
pySim-shell: Include current logical channel in prompt

Now that pySim-shell can switch between logical channels, let's state
the currently used logical channel in the prompt.

Change-Id: I45781a6fba205eeb4ac7f58d5cb642b7131bdd88
Related: OS#6230
The file was modifieddocs/suci-tutorial.rst
The file was modifiedpySim-shell.py
The file was modifieddocs/shell.rst
Commit 10669f2ddf40d4f8293018677535b5626af2720b by laforge
utils: Fix bertlv_encode_tag() for multi-byte tags

We used to support only single-byte tags in bertlv_encode_tag,
let's fix that.  The easy option is to simply call bertlv_parse_tag,
as that already supported multi-byte tags.

Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b
The file was modifiedpySim/utils.py
Commit 307734373937f10305a5c10688a77889730f3b54 by laforge
transport: move init message into concrete classes

In in the module __init__.py we print an init message (which type of
LinkBase class is providing the SimLink). However in __init__.py we tend
to have only platform independed code but the message string can already
be categorized as platform depened. Let's put the init message into the
constructor of the concrete classes of LinkBase.

Related: OS#6210
Change-Id: I0a6dd7deb79a5f3e42b29094a1cf2535075fa430
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/calypso.py
Commit 8c82378bfd74187ece4f4cddb565a9dad3c746ed by laforge
transport: move argument parser setup into concrete classes

The argument parser is set up globally for all LinkBase objects in
__init__.py. Since we tend to have only platform independed code in
__init__.py, we should move the argument parser setup into the
specific LinkBase classes.

Related: OS#6210
Change-Id: I22c32aa81ca0588e3314c3ff4546f6e5092c11df
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/modem_atcmd.py
Commit 268a2025db0e53dc81af7df32f4ed96524d44411 by laforge
Initial support for eUICC

This just adds basic support for the ISD-R application and its
associated STORE DATA command which is used for the ES10x interfaces
between off-card entities and the on-card ISD-R.

Change-Id: Ieab37b083e25d3f36c20f6e9ed3e4bdfdd14a42a
Closes: OS#5637
The file was modifiedpySim/global_platform.py
The file was addedpySim/euicc.py
The file was modifieddocs/shell.rst
The file was modifiedpySim-shell.py
Commit 884eb551afd356c31220bb1cab86c4995231720d by laforge
euicc: Add get_profiles_info command

Example output:

pySIM-shell (02:MF/ADF.ISD-R)> get_profiles_info
{
    "profile_info_seq": {
        "profile_info": {
            "iccid": "98940462222222222222",
            "isdp_aid": "a0000005591010ffffffff8900001200",
            "profile_state": "enabled",
            "service_provider_name": "foobar",
            "profile_name": "foobar",
            "profile_class": "provisioning"
        }
    }
}

Change-Id: I52d136f99dc0eb29905e7ca0cd0865486d3cf65b
The file was modifieddocs/shell.rst
The file was modifiedpySim/euicc.py
Commit cbc0bdfaa9a97c313b43c4bc03b8b041df924579 by laforge
euicc: add some first IoT eUICC commands (GSMA SGP.32)

this is far from being complete, just some basic first commands
to get the certificates and eIM configuration.

Change-Id: Ie05108e635ed9c6de10f0ba431cb1b13893f6be8
The file was modifieddocs/shell.rst
The file was modifiedpySim/euicc.py
Commit 4af63dc760d212b0aab4c628f5083ab9025e0693 by laforge
transport: print reader device/number on init

When we initialize the reader, we currently tell only which type of
interface we are using, but we do not print the reader number or the
device path.

Let's extend the messages so that the path is printed. To prevent
problems with integration-tests, let's also add an environment variable
that we can use to detect when pySim runs inside a integration-test.

Related: OS#6210
Change-Id: Ibe296d51885b1ef5f9c9ecaf1d28da52014dcc4b
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedtests/pySim-trace_test.sh
The file was modifiedpySim/transport/calypso.py
The file was modifiedtests/pySim-prog_test.sh
The file was modifiedpySim/transport/serial.py
Commit 1da8636c0fa1eb4e152e7ac935021e0853b83b7c by pmaier@sysmocom.de
runtime: cosmetic: fix formatting of comment

Change-Id: I4e949a08c1bfab413b82e958a64404390e58148f
The file was modifiedpySim/runtime.py
Commit a24755e066021905268d4b9a9bc6e7406b3464d2 by pmaier@sysmocom.de
filesystem: fix method build_select_path_to

The method build_select_path_to chops off the first element of the
current path. This is done to prevent re-selection of the first file in
the current path.

Unfortunately chopping off the first element in the current path does
not work properly in a situation when the current path points to the MF.
This would chop off the first and last element in the list and the for
loop below would run 0 times.

To fix this, let's keep the first element and chop it off from the
resulting path.

Related: OS#5418
Change-Id: Ia521a7ac4c25fd3a2bc8edffdc45ec89ba4b16eb
The file was modifiedpySim/filesystem.py
Commit 47bb33f937c371877e958183549c65a6c7d1a60d by laforge
docs: shell: Clarify various different card support

Change-Id: Ibf8e3538aa3c954df72c11ec0a2f885031b54b0e
The file was modifieddocs/shell.rst
Commit 0f2faa59fb13edaa9e4d06b0429924e73731a428 by laforge
docs: shell: By now we have encoders/decoders for most files

Change-Id: Ia771f9969ae7eb0094d1768af3f7f54cc9d0d581
The file was modifieddocs/shell.rst
Commit 350cfd822b02e8cfd295a012952bb04b3d80cdc3 by laforge
docs: shell: link to cmd2 documentation

Change-Id: I532cb33781f95fe847db7fae7a5264b5d9c416de
The file was modifieddocs/shell.rst
Commit 0c25e922be25acd92fd89d83478baf29b922e4dc by laforge
docs: shell: Re-order the command sections/classes

the generic pysim command should precede those from specs like ISO7816

Change-Id: I11e66757f10cc28fda547244ae09d51dacd70824
The file was modifieddocs/shell.rst
Commit 6663218ab8d6a9bbefd4f175ce0183823a8c098c by laforge
docs: Fix docstring syntax to avoid warnings

pySim/tlv.py:docstring of pySim.tlv.IE.from_bytes:1: ERROR: Unknown target name: "part".
pySim/tlv.py:docstring of pySim.tlv.IE.to_bytes:1: ERROR: Unknown target name: "part".

Change-Id: I170176910c4519005b9276dbe5854aaaecb58efb
The file was modifiedpySim/tlv.py
Commit aa07ebcdac721971054098a0388520b957b693b4 by laforge
docs: shell: update output in examples

pySim-shell output has changed over time, so some examples were
showing outdated content.  Let's update those.

Change-Id: I4058719c32b61689522e90eba37253e8accb8ba5
The file was modifieddocs/shell.rst
Commit 3d16fdd8daaaa8e9fb677481857d0f9f37b83be7 by laforge
docs: shell: Various documentation updates/extensions

* examples for export, verify_adm, reset, apdu
* explain CSV option for verify_adm
* fix 'tree' example (--help shouldn't be there)

Change-Id: I6ed8d8c5cf268ad3534e988eff9501f388b8d80f
The file was modifieddocs/shell.rst
Commit 0ba3fd996aa4c72118bc670f067596930d9d173c by laforge
pySim-shell: Add copyright statement and link to online manual to banner

This way the users are reminded where they can go to read the manual.

Change-Id: Ie86822e73bccb3c585cecc818d4462d4ca6e43c2
The file was modifiedpySim-shell.py
The file was modifieddocs/shell.rst
Commit 469db9393f18dee986cd0635fc969c050288df36 by laforge
pySim-shell: Use argparser for verify_adm to support --help

Let's add a proper argparser instance for the 'verify_adm' command,
avoiding situations where the user types 'verif_adm --help' and then
--help is interpreted as the PIN value, removing one more attempt from
the failed ADM1 counter.

Let's use that opportunity to improve the documentation of the command.

Change-Id: I3321fae66a11efd00c53b66c7890fce84796e658
The file was modifieddocs/shell.rst
The file was modifiedpySim-shell.py
Commit f9ea63ea51ef4a7bdf6a7ef531a3da9d2d53468e by laforge
pySim-shell: Improved argument validation for verify_adm argument

Let's make sure we don't even bother to ask the card to verify
anything as ADM1 pin which is not either a sequence of decimal digits
or an even number of hex digits (even number of bytes).

Change-Id: I4a193a3cf63462fad73d145ab1481070ddf767ca
The file was modifiedpySim/utils.py
The file was modifiedpySim-shell.py
Commit 4e59d89a5dec1df4700bf732c1802cf6bfcec38b by laforge
pySim-shell: Validate that argument to 'apdu' command is proper hexstr

Let's not even send anything to the card if it's not an even number
of hexadecimal digits

Change-Id: I58465244101cc1a976e5a17af2aceea1cf9f9b54
The file was modifiedpySim/utils.py
The file was modifiedpySim-shell.py
Commit 977c5925a174c53568c79ad0084e2afc3da0960b by laforge
pySim-shell: permit string with spaces for 'echo' command

before this patch:

pySIM-shell (00:MF)> echo foo bar baz
usage: echo [-h] string
echo: error: unrecognized arguments: bar baz

after this patch:

pySIM-shell (00:MF)> echo foo bar baz
foo bar baz

Change-Id: I1369bc3aa975865e3a8a574c132e469813a9f6b9
The file was modifiedpySim-shell.py
Commit 1c849f8bc2aaa9954861703bc6753c8620c2f786 by laforge
pySim-shell: Reject any non-decimal PIN values

Don't even send any non-decimal PIN values to the card, but reject
them when parsing the command arguments.

Change-Id: Icec1698851471af7f76f20201dcdcfcd48ddf365
The file was modifiedpySim-shell.py
The file was modifiedpySim/utils.py
Commit 7be68b29804dcae6f295a08a117f8d13cb8f5639 by laforge
sysmocom_sja2: Add some de/encode test vectors

This increases test coverage and also shows where we so far only
have decoders but no encoders yet

Change-Id: I7932bab7c81a2314c1b9477f50b82a46f24d074e
The file was modifiedpySim/sysmocom_sja2.py
Commit 45477a767b455cb2695c9ff540278ae38835478b by laforge
Use construct 'Flag' instead of 'Bit' for type descriptions

It's better for the human reader (and more obvious that it's a boolean
value) if we decode single Bits as True/False instead of 1/0.

Change-Id: Ib025f9c4551af7cf57090a0678ab0f66a6684fa4
The file was modifiedpySim/sysmocom_sja2.py
The file was modifiedpySim/ts_31_102.py
Commit 2d44f03af21dcc0473b2754ccd32109c489a179a by laforge
transport: Log it explicitly if user doesn't specify a reader

Change-Id: I37e9d62fabf237ece7e49d8f2253c606999d3d02
The file was modifiedpySim/transport/__init__.py
Commit 8fab463e67dc3b41cef6f6ef69f3cc0d42016d5c by laforge
pySim-shell: Move init_card() function to new pySim.app module

The point of this is to move generic code out of pySim-shell.py,
paving the way for more/other executables using the full power of
our class model without having to reinvent the wheel.

Change-Id: Icf557ed3064ef613ed693ce28bd3514a97a938bd
The file was modifiedpySim-shell.py
The file was addedpySim/app.py
Commit 578cf12e734cbec2daf16b390bedf9bfae002431 by laforge
runtime: fix tracking of selected_adf

The class property selected_adf is not updated in all locations where an
ADF is selected, this means that we may loose track of the currently
selected ADF in some locations

Change-Id: I4cc0c58ff887422b4f3954d35c8380ddc00baa1d
Related: OS#5418
The file was modifiedpySim/runtime.py
Commit 40ef226030e670ce6f8c23e5399af07177f06d1a by icecream
ts_31_102: correct name of EF_ePDGId

In 31.102 v17.10, file 6ff3 is called "EF_ePDGId". Adjust the spelling to match.

Change-Id: I2c27a7f325f75274e2110eb312b623cf9e7dab47
The file was modifiedpySim/ts_31_102.py
Commit f1e1e729c4757931e28773ef034e0c614d8d7b82 by pmaier@sysmocom.de
app: do not catch exceptions in init_card

The function init_card catches all exceptions and then returns None
objects for card or rs in case of an error. This does not fit in the
style we pursue in pySim. This is in particular true for library
functions. We want those functions to raise exceptions when something is
wrong, so that we can catch the exception at top level. Let's fix this
for init_card now.

Related: OS#6271
Change-Id: I581125d8273ef024f6dbf3a5db6116be15c5c95d
The file was modifiedpySim/app.py
Commit eb3b0dd3797ffa00afb1d500dd0ad5f8b5d6a146 by pmaier@sysmocom.de
pySim-shell: refuse to execute a startup script on initialization errors

When there is an error on initialization (e.g. card not present), we
should not continue to execute a startup script that was passed with the
pySim-shell commandline. Instead we should print a message that the
startup script was ignored due to errors.

Related: OS#6271
Change-Id: I61329988e0e9021b5b0ef8e0819fb8e23cabf38b
The file was modifiedpySim-shell.py
Commit 1c207a24994a9125f80c015e78239f2cf63707ec by pmaier@sysmocom.de
pySim-shell: Do not use self.lchan.scc when sending raw APDUs.

When sending raw APDUs, we access the scc (SimCardCommands) object via
the scc member in the lchan object. Unfortunately self.lchan will not be
populated when the rs (RuntimeState) object is missing. This is in
particular the case when no profile could be detected for the card,
which is a common situation when we boostrap an unprovisioned card.

So let's access the scc object through the card object. This is also
more logical since when we send raw APDUs we work below the level of
logical channels.

Change-Id: I6bbaebe7d7a2013f0ce558ca2da7d58f5e6d991a
Related: OS#6278
The file was modifiedpySim-shell.py
Commit 4e02436dba52266c30ba6015c5725721fa831d2c by laforge
perform multiple GET RESPONSE cycles if more data is available

So far we implemented only one round of "Send the APDU, get SW=61xx,
call GET RESPONSE".  This permitted us to receive only data up to 256
bytes.

Let's extend that to doing multiple rounds, concatenating the result.
This allows us to obtain arbitrary-length data from the card.

See Annex C.1 of ETSI TS 102 221 for examples showing multiple 61xx
iterations.

Change-Id: Ib17da655aa0b0eb203c29dc92690c81bd1300778
Closes: OS#6287
The file was modifiedpySim/transport/__init__.py
Commit a1850aeccca3c6b62d883612d122e4d022bb4b05 by laforge
filesystem: add flag to tell whether an ADF supports an FS or not

An ADF may or may not support a file system. For example ADF.ARA-M does
not have any filesystem support, which means the SELECT we may use from
this ADF is limited and an can only select a different application. To
know about this in advance let's add a flag that we set when we
instantiate an ADF.

Change-Id: Ifd0f7c34164685ea18d8a746394e55416fa0aa66
Related: OS#5418
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/ts_31_104.py
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/ts_31_103.py
Commit 9c3871177303e950600040463d1664758a555d2f by Neels Hofmeyr
ara_m: Fix encoding of DeviceInterfaceVersionDO

Ever since commit 30de9fd8abc9d7c2c541fea7fa4b97c4ca1a54eb in July
we are (properly) using snake_case names in the from_dict (to become
bijective with to_dict).   This code was not updated by accident,
creating an exception when using the `aram_get_config`

Change-Id: If216b56b38ab17d13896074aa726278b9ba16923
Related: OS#6119
The file was modifiedpySim/ara_m.py
Commit 880db3735689b7cc0b7bb0b826b8acd4bf02dcc2 by laforge
flatten_dict_lists(): Don't flatten lists with duplicate keys

If we have a list of dicts, and we flatten that into a dict: Only
do that if there are no dicts with duplocate key values in the list,
as otherwise we will loose information during the transformation.

Change-Id: I7f6d03bf323a153f3172853a3ef171cbec8aece7
Closes: OS#6288
The file was modifiedpySim/tlv.py
Commit b8b61bf8af925b3c476ed526dc2693c0204aafb8 by pmaier@sysmocom.de
runtime: do not use the _scc object of the card object to select MF

The constructor of the RuntimeState object selects the MF befor it does
some other steps. However it does this through the _scc object of the
card object. This method is before we had lchan abstraction, so we
should now use the lchan object like in all other places.

Related: OS#5418
Change-Id: I9a751c0228c77077e3fabb50a9a68e4489e7151c
The file was modifiedpySim/runtime.py
Commit e30456b07a8ac6e69df7a277549e70178198f7c9 by pmaier@sysmocom.de
runtime: explain why we may access the card object directly

When we are in the constructor of RuntimeState, we may/must access the
card object directly. Let's explain why, since it may not be immediately
obvious.

Change-Id: I01f74d5f021d46679d1c9fa83fb8753382b0f88f
Related: OS#5418
The file was modifiedpySim/runtime.py
Commit c038cccdd8149b28c2f3589cd5ec58daeaa993d5 by pmaier@sysmocom.de
runtime: cosmetic: prnounce file reference data

One of the most important properties of the RuntimeLchan are the
selected_file/adf properties. Let's reformat the code so that those
properties are more pronounced.

Change-Id: I4aa028f66879b7d6c2a1cd102cda8d8ca5ff48b1
Related: OS#5418
The file was modifiedpySim/runtime.py
Commit 0f7d48ed692c834e3d40e16bec0403cf6f6a8755 by laforge
tlv: Fix encoding of zero-valued TLVs

If a TLV was elementary (no nested IEs), and it had only a single
integer content whose value is 0, we erroneously encoded that as
zero-length TLV (len=0, no value part):

>>> rf = pySim.euicc.RefreshFlag(decoded=0);
>>> rf.to_bytes()
b''
>>> rf.to_tlv()
b'\x81\x00'

After this change it is correct:

>>> rf = pySim.euicc.RefreshFlag(decoded=0);
>>> rf.to_bytes()
b'\x00'
>>> rf.to_tlv()
b'\x81\x01\x00'

Change-Id: I5f4c0555cff7df9ccfc4a56da12766d1bf89122f
The file was modifiedpySim/tlv.py
Commit 008cdf4664802bc322d1f5bc60b3b5fe5bd4745f by laforge
euicc: Fix encoding of {enable,disable,delete}_profile

The encoding was missing a "CHOICE" container and missed the
fact that the refreshFlag presence is mandatory for enable+disable.

Change-Id: I12e2b16b2c1b4b01dfad0d1fb485399827f25ddc
The file was modifiedpySim/euicc.py
Commit 5482737f31bdad8ab9688c35d6cda2cc17de6d96 by laforge
pySim-shell: don't get trapped in applications without file system

When we traverse the file system, we may also end up selecting
applications (ADF), which do not support an USIM/ISIM like file system.
This will leave us without the ability to select the MF (or any other
file) again. The only way out is to select the ISIM or USIM application
again to get the access to the file system again.

Change-Id: Ia2fdd65f430c07acb1afdaf265d24c6928b654e0
Related: OS#5418
The file was modifiedpySim-shell.py
Commit 2b6deddcdc4eaafa70538e6fe17b49786d3cd21c by laforge
euicc: the ICCID TLV object uses bcd-swapped-nibble encoding

Change-Id: I050f9e0fb128f3e1d472e2330b136a753794a5a1
The file was modifiedpySim/euicc.py
Commit c20d442695dbdd8b46dfe9bbf87bd8c37cd813ae by laforge
euicc: Fix encoding of Lc value in STORE DATA

The length value "of course" is a hex value, don't use %02u but %02x

This fixes any eUICC command with a Lc > 10 bytes.

Change-Id: I1e1efbfb9916fc43699602cc889cf4b3d42736f2
The file was modifiedpySim/euicc.py
Commit b582c3c7ea1cb46deb074979e48b20d3e7100732 by laforge
euicc: Fix TLV IE definitions for SetNickname{Req,Resp}

The metaclass uese the 'nested' attribute, while the existing code
accidentially used the 'children' attribute.  The latter is used
by instances for actual child classes, while the Class/nested
attribute is for the list of classes whose instancse could be potential
children.

Change-Id: I968bd84d074dcdcec37d99be5d3d4edac9c35a0c
The file was modifiedpySim/euicc.py
Commit 174fd32f17b7147724933cc3d8e33ebbb9541831 by pmaier@sysmocom.de
runtime: explain how file probing works

We use a trick to probe a file (that does not exist in the local file
model yet). Let's explain further how that works, in particular why we
do not have to upate any state if probing fails.

Change-Id: I2a8af73654251d105af8de1c17da53dfa10dc669
Related: OS#5418
The file was modifiedpySim/runtime.py
Commit 14bf003dadef313635599dfb98edf8295d7f6237 by pmaier@sysmocom.de
filesystem: use sort path when selecting an application

The method build_select_path_to uses the internal file system tree model
to find the path to a given file. This works the same for applications
(ADF) as it works for normal files (EF/DF). However, an application can
be selected anytime from any location in the filesystem tree. There is
no need to select a specific path leading to that application first.
This means that if there is an ADF somewhere in the resulting
inter_path, we may clip everything before that ADF.

Related: OS#5418
Change-Id: I838a99bb47afc73b4274baecb04fff31abf7b2e2
The file was modifiedpySim/filesystem.py
Commit 82cc7cc11a9287444564940d86be7fea53c8089f by pmaier@sysmocom.de
runtime: refactor file selection methods select and select_file

The implementation of the methods select and select_file of class
RuntimeLchan is a bit complex. We access the card directly in several
places which makes it difficult to track the state changes. We should
clean this up so that we call self.rs.card.select_adf_by_aid/
self.scc.select_file from a single place only.

This means that the method select uses the method select_file. This
results in a much cleaner implementation. We also should take care
that the important states that we track (selected_file, selected_adf,
etc.) are updated by a single private method. Since the update always
must happen after a select _select_post is a good place to do this.

Related: OS#5418
Change-Id: I9ae213f3b078983f3e6d4c11db38fdbe504c84f2
The file was modifiedpySim/runtime.py
Commit a5707c7dfba189ff83c8b6a91d8d715aab7d2dc2 by pmaier@sysmocom.de
filesystem: fix typo

Change-Id: I721875d302ab69340d56b33102297b56c070465f
The file was modifiedpySim/filesystem.py
Commit 5277b5cf2ce4da529db92ccc63389208a773af46 by laforge
USIM: add support for EG.ePDGIdEm (Emergency ePDG)

Change-Id: I71cb7a4b9323f57b96db2d9f12f1567eda63f742
The file was modifiedpySim/ts_31_102.py
Commit cdfe1c24af8975cb29f354085533305053d4ec2c by laforge
usim: Add EF.ePDGSelection + EF.ePDGSelectionEm support

Change-Id: I760a394ae1eac5f1175dc9b86c11b4a60671582e
The file was modifiedpySim/ts_31_102.py
Commit 478b5fe8e39dfb20874ad922ffbbedc4d4ed0f8c by laforge
usim: ePDGId + ePDGSelection: Fix encoder/decoder + add test cases

Change-Id: Idca19b6fdabae6cc708e92c7714fa0903ea5a1ee
The file was modifiedpySim/ts_31_102.py
Commit 6e9ae8a5847dd725671898290ba5147aeebde906 by laforge
usim: Properly decode/encode IPv4 + IPv6 addresses

use normal textual representation for IPv4 and IPv6 addresses

Change-Id: I2c6c377f4502af37639e555826c85d5dcf602f9b
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/construct.py
Commit b3c46135bb87893d504750ceadfb32df2b17cff2 by laforge
bertlv_parse_len: Fix input data is smaller than num length octets

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
The file was modifiedpySim/utils.py
Commit 301d6ed14a25b828a458654c9a1d8147cfd91a9c by laforge
isim: Replace legacy imperative address TLV encoder/decoder with construct

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
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
The file was modifiedpySim/ts_31_103.py
Commit c1085950415f40134b6bc6b4370ce497e7aa63bc by laforge
move {enc,dec}_addr_tlv functions from pySim.util to pySim.legacy.util

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
The file was modifiedpySim/legacy/utils.py
The file was modifiedpySim/legacy/cards.py
The file was modifiedpySim/utils.py
Commit 0f177c1d290202d808c94eb084f45ae6b383da26 by laforge
transport: Pass argparse.Namespace directly into transport classes

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
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/serial.py
The file was modifiedcontrib/sim-rest-server.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/__init__.py
Commit ad002797e2bffb8b6a39a839429ba0f8e62b9b79 by laforge
transport/pcsc: Allow opening PC/SC readers by a regex of their name

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
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/__init__.py
Commit baec4e9c81d42a42799062ac7595bc74f0b2b5f5 by laforge
transport: Move printing of reader number/name to generic code

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
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/pcsc.py
Commit 0ecbf63a02ce625f8ad4254d3f26ad4c2994ed69 by laforge
transport: Extend the documentation for each transport driver

This driver description we add to the code is automatically added to the
respective user manual sections.

Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/calypso.py
Commit 2822dca9ec68ea14fac98e1a47a17735dde56ea4 by laforge
tests: use case-insensitive compare of hex strings

Change-Id: I080f6e173fec40c27dd3ebbf252eaddf5a0e15ba
The file was modifiedtests/test_files.py
Commit e45168ef29a3226ab16497c4c07da4575ab1601a by laforge
test/test_files: set maxDiff attribute

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
The file was modifiedtests/test_files.py
Commit 542dbf67716f5486dba612ab94da07b6a812599f by laforge
fix encode/decode of xPLMNwAcT

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
The file was modifiedpysim-testdata/sysmoUSIM-SJS1.ok
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
The file was modifiedpySim/ts_51_011.py
The file was modifiedtests/test_utils.py
The file was modifiedpySim/utils.py
The file was modifiedpysim-testdata/Fairwaves-SIM.ok
The file was modifiedpysim-testdata/sysmoISIM-SJA2.ok
The file was modifiedpysim-testdata/Wavemobile-SIM.ok
Commit 537625199379d10c63c5b8d8b42599f5d4c76db8 by laforge
31.102 + 51.011: Fix encode/decode of EF.CFIS

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
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/ts_51_011.py
Commit 324175f8bd1b76a475f51a785d94c1b43aa60800 by laforge
additional encode/decode test data for various files

Change-Id: Ib563a2204922d2013b5f7c5abde0773051e17938
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/ts_31_103.py
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/ts_31_102.py
Commit 188869568a73660dcfa4a22d05471125f79578f4 by laforge
docs/shell: extend the introduction part; link to video presentation

Change-Id: I77c30921f2b8c002c9dda244656c348c96b41f06
The file was modifieddocs/shell.rst
Commit caef0df6638277e1b8ff01b314146944e2b5a61e by laforge
construct/tlv: Pass optional 'context' into construct decoder/encoder

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
The file was modifiedpySim/tlv.py
The file was modifiedpySim/construct.py
Commit a4b9bdf23851cc9213b556113fc1727c869467bf by laforge
pySim-trace_test.sh: Force termcolor to suppress color generation

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 file was modifiedtests/pySim-trace_test.sh
Commit a5eb924f9efdfe2bd74f406a7172fd526877a394 by laforge
filesystem: use pySim.utils.build_construct()

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
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/sysmocom_sja2.py
Commit a9b21bdb1f24e3eabcee82950e4a3efdb90b2fa9 by laforge
tlv: Fix from_dict() symmetry

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
The file was modifiedpySim/tlv.py
Commit 2a36c1b9213aa01159557d119e46be88466a2964 by laforge
data-driven TLV unit data test support

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 file was addedtests/test_tlvs.py
Commit ee6a95177496dfae9c890136745d00b809803a62 by laforge
Add TLV decoder test data

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
The file was modifiedpySim/ts_102_221.py
Commit 2538dd7621d4aac9956735b3187487520c4f7827 by laforge
global_platform: Correctly decode Key Information Data

The list contains tuples of (key_type, key_length). Let's fix that.

Change-Id: Icf367827d62ed67afa27ee3d0ba9d5cd5bc65c99
The file was modifiedpySim/global_platform.py
Commit 45626271cf4a28dbb0010aa35a28fa671c0c9f9c by laforge
global_platform: Add TLV test data for Key Information Data

Change-Id: Ib7b73cb28abea98986a66264a0779263873d7fb2
The file was modifiedpySim/global_platform.py
The file was modifiedtests/test_tlvs.py
Commit 722c11a7e9d509700d781140392110b36887269e by laforge
global_platform: Add support for key types of v2.3.1 (including AES)

Change-Id: Iae30f18435c2b0a349bfd9240b9c7cca06674534
The file was modifiedpySim/global_platform.py
Commit dffe7af5789d9a59d6e12c43a449eaf2955f8443 by laforge
Fix enumeration of GlobbalPlatformISDR during card_init()

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
The file was modifiedpySim/global_platform.py
The file was modifiedpySim/app.py
Commit 842fbdb15d50588bc427e9ed75ad720e578efb38 by laforge
add PlmnAdapter for decoding PLMN bcd-strings like 262f01 to 262-01

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
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/gsm_r.py
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/construct.py
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
The file was modifiedpySim/cat.py
Commit f6fceb8684c6aaccdf2d0661663866a52bb0cc66 by laforge
Implement convoluted encoding of UCS-2 as per TS 102 221 Annex A

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 file was modifiedtests/test_construct.py
The file was modifiedpySim/construct.py
Commit 6e6caa8b4ad42980e312910d39800b6b618091ea by laforge
support UCS-2 characters in EF.MMSUP, EF.ADN, EF.SPN, EF.PNN, EF.ECC

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
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/construct.py
The file was modifiedpySim/ts_31_102.py
Commit a77f7e1eb958a638ccc0f5cf3f1adf74656d5987 by laforge
ts_31_102: Implement decoders/encoders for EFs below DF.HNB

These files are mostly related to CSG (Closed Subscriber Group)
in the context of HomeNodeB (HNB), aka femtocells.

Change-Id: Ie57963381e928e2c1da408ad46549a780056242a
The file was modifiedpySim/ts_31_102.py
Commit 69bdcf50228a947a39cbf0c9b25ec1f21eaaf276 by laforge
Fix TLV_IE_Collection.from_tlv in certain situations

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
The file was modifiedpySim/tlv.py
Commit bcd261583cc8e292aab33e7607188b6b55109fbd by laforge
tests_files.py: Reduce code duplication

Change-Id: Ib84a0ae35262a19fce3e688afe8e1678a4c59eba
The file was modifiedtests/test_files.py
Commit ce01f48b0084e067abd7718e207a6f2b85a5471e by laforge
test_files: Test decoder also with ff-padded input

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
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/cdma_ruim.py
The file was modifiedtests/test_files.py
The file was modifiedpySim/ts_31_102.py
Commit db1684df044c9d7ac2ae3802df8e6d7109000b27 by laforge
sysmocom_sja2: Implement EF_CHV files using construct

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
The file was modifiedpySim/sysmocom_sja2.py
Commit 1c0a2491317d8ea82d3d1f3e0314befe46513282 by laforge
commands: Ignore exceptions during READ while UPDATE

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
The file was modifiedpySim/commands.py
Commit 9d607978fa290e0d80863d70f9fa462366631496 by laforge
global_platform: Add support for more GET DATA TLVs

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
The file was modifiedpySim/global_platform.py
Commit 19d2b93d7e4ab4ee9f4a2b6c8b55c25e3f73fba0 by laforge
move SUCI sub-classes to EF_SUCI_CalcInfo

Change-Id: Iea6b176327881ff9414f4fe624e94811f9782927
The file was modifiedpySim/ts_31_102.py
Commit 9a48aea263af1f9777b418c3fda154c29253f5e8 by laforge
fileystem/tlv: remove unused imports

Change-Id: I519c7792c7fbe18be63ddc77d211f0d034afcd1f
The file was modifiedpySim/tlv.py
The file was modifiedpySim/filesystem.py
Commit e13403b2065f53c648929861132b7b77fef6e6e7 by laforge
ts_31_102: Start to use construct for EF.SUCI_Calc_Info

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
The file was modifiedpySim/ts_31_102.py
The file was modifiedtests/test_utils.py
Commit b0c9ccba66ebe861a7ff8b18e2f778a0d365670b by laforge
construct: avoid StreamError exceptions due to files containing all-ff

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
The file was modifiedpySim/construct.py
Commit 4fe7de85682de0a1277325df8372e0c8a8f07dcc by laforge
ts_31_103: Add construct for EF.GBABP and EF.GBANL

Change-Id: Ife06f54c2443f3e048bd36f706f309843703403a
The file was modifiedpySim/ts_31_103.py
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
Commit 62e570b6209bc809e754fe309dac6920aec20630 by laforge
ts_31_103: Add TLV + construct for EF_NAFKCA

Change-Id: I124064994eb695790e9a3aff40be8139b3a2f2cf
The file was modifiedpySim/ts_31_103.py
Commit 5b623a124701cd170ea6c25f7769261a346914c2 by laforge
ts_102_310: Add file definitions resembling ETSI TS 102 310 (EAP)

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
The file was addedpySim/ts_102_310.py
Commit 242197b53dbbe81a8838244af62739f841fd0766 by laforge
Add pySim.esim.bsp module implementing BSP (BPP Protection Protocol)

This is the protocol used for the ES8+ interface between SM-DP+ and the
eUICC in the GSMA eSIM system.

Change-Id: Ic461936f2e68e1e6f7faab33d06acf3063e261e7
The file was modifiedrequirements.txt
The file was addedtests/test_esim_bsp.py
The file was addedpySim/esim/__init__.py
The file was addedpySim/esim/bsp.py
Commit d657708df25fb8d29f7091f35bb5809668ff3b91 by laforge
add contrib/unber.py utility

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
The file was addedcontrib/unber.py
Commit cfa62cb95b2d0894db40d184ebc4ffeb8c453444 by laforge
Allow logger to do lazy evaluation of format strings

Change-Id: I39d26cdd5b85a61a06fd8c7a9d0a046e398819bd
The file was modifiedpySim-trace.py
The file was modifiedpySim/apdu_source/pyshark_rspro.py
The file was modifiedpySim/apdu/ts_102_221.py
Commit 0002789a88c42d223b715cd8b091cfea54d6b5d8 by laforge
euicc: Fix delete_profile command

Contrary to {enable,disable}_profile, the delete_profile does not use
the ProfileIdentifier TLV, but directly the Iccid / IsdpAid.

Change-Id: I43e298524048703264e16cbdd0b76d82ba976985
The file was modifiedpySim/euicc.py
Commit c499dc79a84a3bc31bb65f44684363f2b910d09f by laforge
euicc: Fix eUICC list_notifications command

Prior to this patch, the command would always raise exceptions.

Change-Id: I75a7840c3f4b68bfc164a43908b100dd6e41e575
The file was modifiedpySim/euicc.py
Commit e76fae9c4c339408f85be5b59ece941664e75ad8 by laforge
pySim-shell: Update manual with examples for using with eUICC ISD-R

Change-Id: I4a0acdad5c7478ee76f92c7610c0e2a5331dea46
The file was modifieddocs/shell.rst
Commit 5bbb144a319393e0b2bdd06f403905f28528e459 by laforge
Initial proof-of-concept SM-DP+ for GSMA consumer eSIM RSP

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
The file was addedsmdpp-data/upp/TS48 V2 eSIM_GTP_SAIP2.1_NoBERTLV.rename2der
The file was addeddocs/osmo-smdpp.rst
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_BRP.der
The file was addedsmdpp-data/certs/DPpb/PK_S_SM_DPpb_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPpb/PK_S_SM_DP2pb_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPauth/PK_S_SM_DP2auth_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/CertificateIssuer/CERT_CI_ECDSA_BRP.der
The file was addedpySim/esim/es8p.py
The file was addedsmdpp-data/certs/DPpb/SK_S_SM_DP2pb_ECDSA_BRP.pem
The file was addedtests/test_esim.py
The file was addedsmdpp-data/certs/DPpb/SK_S_SM_DPpb_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/README
The file was addedpySim/esim/asn1/rsp/PKIX1Explicit88.asn
The file was addedsmdpp-data/certs/DPauth/CERT_S_SM_DPauth_ECDSA_NIST.der
The file was addedsmdpp-data/certs/DPauth/SK_S_SM_DPauth_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPpb/PK_S_SM_DPpb_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/DPtls/PK_S_SM_DP4_TLS.pem
The file was modifieddocs/index.rst
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2022/CERT_S_SM_DP_TLS_NIST.der
The file was addedsmdpp-data/certs/DPauth/PK_S_SM_DP2auth_ECDSA_BRP.pem
The file was modifiedtests/test_esim_bsp.py
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2022/CERT_S_SM_DP4_TLS.der
The file was addedsmdpp-data/certs/DPpb/SK_S_SM_DPpb_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS.ext.cnf
The file was addedsmdpp-data/certs/DPauth/SK_S_SM_DP2auth_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPpb/CERT_S_SM_DP2pb_ECDSA_NIST.der
The file was addedsmdpp-data/certs/DPtls/PK_S_SM_DP_TLS_BRP.pem
The file was addedsmdpp-data/certs/DPauth/PK_S_SM_DPauth_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPauth/CERT_S_SM_DP2auth_ECDSA_NIST.der
The file was addedsmdpp-data/certs/CertificateIssuer/CI-csr.cnf
The file was addedsmdpp-data/certs/DPpb/CERT_S_SM_DP2pb_ECDSA_BRP.der
The file was addedsmdpp-data/certs/DPpb/SK_S_SM_DP2pb_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2021/CERT_S_SM_DP_TLS_NIST.der
The file was modifiedpySim/esim/__init__.py
The file was addedsmdpp-data/certs/CertificateIssuer/CERT_CI_ECDSA_BRP.pem
The file was addedsmdpp-data/certs/DPauth/SK_S_SM_DPauth_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/DPtls/SK_S_SM_DP2_TLS_NIST.pem
The file was addedsmdpp-data/certs/DPtls/SK_S_SM_DP_TLS_BRP.pem
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP2_TLS.der
The file was addedsmdpp-data/certs/DPtls/SK_S_SM_DP_TLS_NIST.pem
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP4_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2023/CERT_S_SM_DP8_TLS.der
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP4_TLS.ext.cnf
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP8_TLS.der
The file was addedsmdpp-data/certs/DPauth/CERT_S_SM_DP2auth_ECDSA_BRP.der
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP2_TLS.csr.cnf
The file was addedsmdpp-data/certs/DPtls/SK_S_SM_DP8_TLS.pem
The file was addedpySim/esim/rsp.py
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP2_TLS.ext.cnf
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2023/CERT_S_SM_DP_TLS_BRP.der
The file was addedsmdpp-data/certs/DPauth/PK_S_SM_DPauth_ECDSA_NIST.pem
The file was addedpySim/esim/asn1/rsp/rsp.asn
The file was addedsmdpp-data/certs/DPauth/CERT_S_SM_DPauth_ECDSA_BRP.der
The file was addedsmdpp-data/certs/DPpb/PK_S_SM_DP2pb_ECDSA_NIST.pem
The file was addedpySim/esim/asn1/rsp/PKIX1Implicit88.asn
The file was addedsmdpp-data/certs/DPpb/CERT_S_SM_DPpb_ECDSA_BRP.der
The file was addedsmdpp-data/certs/DPauth/SK_S_SM_DP2auth_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2023/CERT_S_SM_DP2_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2023/CERT_S_SM_DP_TLS_NIST.der
The file was addedosmo-smdpp.py
The file was addedsmdpp-data/certs/DPtls/PK_S_SM_DP_TLS_NIST.pem
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2021/CERT_S_SM_DP4_TLS.der
The file was addedsmdpp-data/certs/CertificateIssuer/CERT_CI_ECDSA_NIST.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2023/CERT_S_SM_DP4_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2021/CERT_S_SM_DP2_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2022/CERT_S_SM_DP2_TLS.der
The file was addedsmdpp-data/certs/DPtls/SK_S_SM_DP4_TLS.pem
The file was added.checkpatch.conf
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2022/CERT_S_SM_DP8_TLS.der
The file was addedsmdpp-data/certs/DPtls/PK_S_SM_DP2_TLS_NIST.pem
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP8_TLS.ext.cnf
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP8_TLS.csr.cnf
The file was addedsmdpp-data/certs/DPauth/data_sig.der
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.der
The file was addedsmdpp-data/certs/DPpb/CERT_S_SM_DPpb_ECDSA_NIST.der
The file was modifiedrequirements.txt
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2021/CERT_S_SM_DP8_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2021/CERT_S_SM_DP_TLS_BRP.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2022/CERT_S_SM_DP_TLS_BRP.der
The file was addedsmdpp-data/certs/DPtls/PK_S_SM_DP8_TLS.pem
The file was addedsmdpp-data/upp/TS48 V2 eSIM_GTP_SAIP2.3_NoBERTLV.rename2der
The file was addedsmdpp-data/certs/CertificateIssuer/CERT_CI_ECDSA_NIST.pem
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP4_TLS.csr.cnf
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS.csr.cnf
Commit f2bcb44ccc5fb342aef4ae22fdd809ed43458efd by laforge
pySim.saip.*: Support for parsing / operating on eSIM profiles

This commit introduces the capability to parse and encode
SimAlliance/TCA "Interoperable Profiles" and apply personalization
operations on them.

Change-Id: I71c252a214a634e1bd6f73472107efe2688ee6d2
The file was addedpySim/esim/saip/__init__.py
The file was addedpySim/esim/asn1/saip/PE_Definitions-3.3.1.asn
The file was addedpySim/esim/saip/validation.py
The file was addedpySim/esim/saip/personalization.py
The file was addedtests/test_esim_saip.py
Commit d1cc8d0c1d02bb87c9073d621e6ffc63fb08dfd8 by laforge
euicc: Fix decoding of SubjectKeyIdentifier.

There's actually no additional TLV structure inside the Tag 0x04.

Change-Id: Ic922355308747a888083c5b26765d272b6b20bd0
The file was modifiedpySim/euicc.py
Commit 91842b471db50de2d704119cf93b79467654b971 by laforge
Constrain user input to hex-string in argparse

We do have an is_hexstr function which we should use anywhere
where we expect the user to input a string of hex digits.  This way
we validate the input before running in some random exception.

Change-Id: I6426ea864bec82be60554dd125961a48d7751904
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/ts_102_222.py
Commit 7ba09f9392c8023842a7b5576936cb21ff85c6c0 by laforge
euicc: Migrate ECASD + ISD-R over to global_platform.CardApplicationSD

Actually, the GSMA eUICC is a kind of derivative of a GlobalPlatform
card, and the ECASD and ISD-R are security domains.  As such, we
should make them derived classes of global_platform.CardApplicationSD
which means they inherit some of the shared shell_commands etc.

Change-Id: I660e874d9bcbb8c28a64e4ef82dc53bee97aacfc
The file was modifiedpySim/euicc.py
Commit d5be46ae7e84c10445e00d8b4d30799a2a1b1884 by laforge
global_platform: Implement generic store_data command

Change-Id: If30c5d31b4e7dd60d3a5cfb1d1cbdcf61741a50e
The file was modifiedpySim/global_platform.py
Commit 1f7a9bd5b40da67d2d8fbccb190d86c50db241d5 by laforge
TLV: Add DGI encoding of "GP Scripting Language Annex B"

The DGI encoding is specified in Annex B of the
"GlobalPlatform Systems Scripting Language Specification v1.1.0"

which is an "archived" specification that is no longer published
by GlobalPlatform, despite it being referenced from the GlobalPlatform
Card Specification v2.3, which is the basis of the GSMA eSIM
specifications.

For some reason it was the belief of the specification authors that
yet another format of TLV encoding is needed, in addition to the BER-TLV
and COMPREHENSION-TLV used by the very same specifications.

The encoding of the tag is not really specified anywhere, but I've only
seen 16-bit examples.  The encoding of the length is specified and
implemented here accordingly.

Change-Id: Ie29ab7eb39f3165f3d695fcc1f02051338095697
The file was modifiedpySim/utils.py
The file was modifiedtests/test_utils.py
The file was modifiedpySim/tlv.py
Commit ecfb09037e4dbad54b06bacaa43aa6015f769593 by laforge
global_platform: More definitions to support key loading

With the definitions from this commit, we can build key loading
TLVs, which is used to load ECC keys into eUICCs.

Change-Id: I853c94d37939ef3dd795f893232b0276a5a4af81
The file was modifiedpySim/global_platform.py
Commit cd18ed0a82403bc8d4d36649d56bc5e5ee5676d4 by laforge
ts_102_221: Better explain 'selected file invalidated'

Some specs call it 'invalidated', others call it 'deactivated'.  If the
user is unfamiliar with this, the error message about "invalidated"
might not be obvious enough; let's also mention 'deactivated' in the
message and explicitly mention that it needs to be activated before use.

Change-Id: I91488b0e7dc25a8970022b09e575485a4165eefa
The file was modifiedpySim/ts_102_221.py
The file was modifieddocs/shell.rst
The file was modifiedpySim-shell.py
Commit 4f3d11b378b6b37f7e39b523652b0eaea052c955 by laforge
euicc: Implement EID checksum verification + computation

Change-Id: I2cb342783137ee7e4b1be3b14e9c3747316f1995
The file was modifiedpySim/euicc.py
The file was addedtests/test_euicc.py
Commit 66b337079a17aea5105b64cc381103157dcc9a9d by laforge
pySim-shell: Permit 'reset' command also in unqeuipped stage

If we are not 'equipped' as we could not detect any known applications
on the card, we used to only permit the 'apdu' command. However, we
should also permit the 'reset' command, as it also is something that's
possible with ever card, even of unknown types.

Change-Id: I23199da727973d7095ac18031f49e1e8423aa287
The file was modifiedpySim-shell.py
Commit 0311c92e961b61b5c4b383558cd8d15408be90d9 by laforge
Fix encoding of decoded/json data in update_{record_binary}_decoded

The patch introducing the is_hexstr type into the argparser was
accidentially also introduce in two locations where we actually don't
expect a hex-string.

This is a partial revert of I6426ea864bec82be60554dd125961a48d7751904

Change-Id: I3c3d2a2753aa7a2566a3b1add7ba70c86499d293
Closes: #6331
The file was modifiedpySim/filesystem.py
Commit ebb6f7f938a612bd03331921337b67c9388c19a8 by laforge
osmo-smdpp: Actually dump Rx/Tx JSON in JSON format and not as python dict

Change-Id: Ieea3fd2d0f0239acfa6a5c4cfdbfd558d1a3e0ea
The file was modifiedosmo-smdpp.py
Commit 667d589f20ec1e2c2602020addf313622eb353b3 by laforge
pySim.utils: Support datetime.datetime in JsonEncoder

Change-Id: I6223475cec8eb45c6fc4278109ad9dd1cb557800
The file was modifiedpySim/utils.py
Commit c83a963877215db3161b2ab70b545204ea8143d5 by laforge
New pySim.esim.x509_cert module for X.509 certificate handling

Change-Id: Ia8cc2dac02fcd96624dc6d9348f103373eeeb614
The file was addedpySim/esim/x509_cert.py
Commit 45b7dc9466e1cd450af684d2c7076da4d0d05802 by laforge
Move X.509 related code from osmo-smdpp to pySim.esim.x509_cert

Change-Id: I230ba0537b702b0bf6e9da9a430908ed2a21ca61
The file was modifiedosmo-smdpp.py
The file was modifiedpySim/esim/x509_cert.py
Commit af87cd544f784e51a41cea303cb57001d9954d9c by laforge
osmo-smdpp: Implement eUICC + EUM certificate signature chain validation

Change-Id: I961827c50ed5e34c6507bfdf853952ece5b0d121
The file was modifiedpySim/esim/rsp.py
The file was modifiedosmo-smdpp.py
Commit 6dadb6c215055949927977e77d960d905802b507 by laforge
docs: Update osmo-smdpp with pointer to sysmoEUICC1-C2T and SGP.26

Change-Id: Id031ca48549a3c2ac21c93a169262570843d8e2d
The file was modifieddocs/osmo-smdpp.rst
Commit e6124b0abad0a8ff786cc1950e3e0223a7af411c by laforge
add contrib/eidtool.py: Tool for checking + computing EID checksum

Change-Id: If6c560a2de51718948fb99b816e080f2aff4d0ed
The file was addedcontrib/eidtool.py
Commit 280a9a340856641593c0570e262d68bda072fad1 by laforge
docs: Add missing global_platform store_data command docs

In If30c5d31b4e7dd60d3a5cfb1d1cbdcf61741a50e we introduced a store_data
comamnd, but forgot to add it to the pySim-shell manual.

Change-Id: I6039818c2c0c5373b4a4ef1e33e152de7fbbd01a
The file was modifieddocs/shell.rst
Commit 18d0a7de96a1f2437d69ce140b8f727fc187ad8e by laforge
global_platform: Add shell command for PUT KEY

This command is used for installation of GlobalPlatform keys.  We only
implement the command without secure messaging at this point, as it is
used during card personalization.  Authentication will later be handled
by generic implementations of SCP02 and/or SCP03.

Change-Id: Icffe9e7743266d7262fbf440dd361b21eed7c5cf
The file was modifieddocs/shell.rst
The file was modifiedpySim/global_platform.py
Commit 9fd4bbe42e9659012784530365cd52a0510faaf0 by laforge
osmo-smdpp: Constrain selection of CI certificate

We can only choose a CI certificate which is supported both by the eUICC
as well as which has signed our own SM-DP+ certificates.

Change-Id: I0b9130f06d501ca7d484063d56d606cfdd2544f4
The file was modifiedosmo-smdpp.py
Commit 5e0439f881a8f94671742181dea8012a33f6c1d1 by laforge
ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules

Encoding an empty AID-REF-DO (4F) is neccessary to achieve the meaning
described in "Secure Element Access Control - Public Release v1.0"
Table 6-1: "Empty: Indicates that the rules to be stored or retrieved
are associated with all SE applications not covered by a specific rule".

Change-Id: Iac6c3d78bc9ce36bac47589e5f7a0cc78e2efc38
The file was modifiedpySim/ara_m.py
Commit 9b1a9d9b2ebaa4038a49f7b60302becf74a100ce by laforge
ara_m: Use GlobalPlatform SELECT decoding

As the ARA-M applet is a GlobalPlatform applet, its SELECT response
decoding should be used, not the ETSI EUICC TS 102 221 fall-back.

Change-Id: I1a30b88a385f6de663aa837483dd32c0d104856f
The file was modifiedpySim/ara_m.py
Commit 7f2263b4a005f8ee50507068ee1192c618e23bc4 by laforge
runtime: Reset selected_file_fcp[_hex] if SELECT returns no data

In case SELECT doesn't return any response data, we must reset
the lchan.selected_file_fcp* members to None to prevent pySim-shell
preventing stale data from the previously selected file.

Change-Id: Ia04b8634e328e604e8df7e8d59b7fd532242d2ca
The file was modifiedpySim/runtime.py
Commit 3d6df6ce13e2c328f1b3eb87f24506a8f7d82d46 by laforge
[cosmetic] ara_m: Give a spec reference for the PERM-AR-DO

PERM-AR-DO actually originates in a different spec than all other parts
of the ara_m.py, so let's explicitly mention that.

Change-Id: I6e0014c323f605860d0f70cd0c04d7e461e8a9de
The file was modifiedpySim/ara_m.py
Commit 0bce94996f40af915ee1265abd480473d64c2999 by laforge
saip.personalization: Also drop any fillFileOffset

When replacing a file's contents, we must not just remove any
fillFileContent tuples, but also the fillFileOffset.

Change-Id: I3e4d97ae9de8a78f7bc0165ece5954481568b800
The file was modifiedpySim/esim/saip/personalization.py
Commit 488427993ddab041e70452f8e749dddf1d0d57a4 by laforge
saip.personalization: Fix ICCID fillFileContent replacement

Change-Id: Ic267fdde3b648b376ea6814783df1e90ea9bb9ad
The file was modifiedpySim/esim/saip/personalization.py
Commit 9f55da998f986ada16907436f98d0345fc34a0c4 by laforge
esim.saip: Move OID to separate sub-module

This helps us to prevent circular imports in follow-up code.

Change-Id: I94f85f2257d4702376f4ba5eb995a544a2e53fd3
The file was addedpySim/esim/saip/oid.py
The file was modifiedpySim/esim/saip/__init__.py
Commit e815e79db95444911f7bb89ed4600b0e98a7957f by laforge
esim.saip: More type annotations

Change-Id: Ib549817ee137bab610aea9c89a5ab86c2a7592ea
The file was modifiedpySim/esim/saip/__init__.py
Commit 263e3094ba445acf2ad5ee50d31dbca6a7c3ddc5 by laforge
requirements.txt: Switch to osmocom fork of asn1tools

This is sadly required as the Interoperable Profile format must process
elements of an ASN.1 sequence in order, which doesn't work if the parser
puts the elements in a python dict.

The osmocom fork of asn1tools hence uses OrderedDict to work around
this problem.

Change-Id: Id28fcf060f491bb3d76aa6d8026aa76058edb675
The file was modifiedrequirements.txt
Commit 3f3fd1a84153c7fa59b7cf75a02aee167dd67a94 by laforge
add SAIP template handling + v3.1 definitions

This adds classes for describing profile templates as well
as derived classes defining the profile templates of the
"Profile Interoperability Technical Specification", specifically
it's "ANNEX A (Normative): File Structure Templates Definition"

We need a machine-readable definition of those templates, so
we can fully interpret an unprotected profile package (UPP),
as the UPP usually only contains the increment/difference to
a given teplate.

Change-Id: I79bc0a480450ca2de4b687ba6f11d0a4ea4f14c8
The file was modifiedpySim/esim/saip/oid.py
The file was addedpySim/esim/saip/templates.py
Commit 8a39d00cc329b53cfd8b781fbffd79907c63559a by laforge
osmo-smdpp: Support multiple different profiles

Let's simply use the matchingId for filesystem lookup of the UPP file.

This way we can have any number of profiles by simply creating the
respeective files.

Change-Id: I0bc3a14b9fdfcc6322917dd0c69d8295de486950
The file was modifieddocs/osmo-smdpp.rst
The file was modifiedtests/test_esim_saip.py
The file was addedsmdpp-data/upp/TS48v2_SAIP2.1_NoBERTLV.der
The file was modifiedosmo-smdpp.py
The file was removedsmdpp-data/upp/TS48 V2 eSIM_GTP_SAIP2.1_NoBERTLV.rename2der
The file was removedsmdpp-data/upp/TS48 V2 eSIM_GTP_SAIP2.3_NoBERTLV.rename2der
The file was addedsmdpp-data/upp/TS48v2_SAIP2.3_NoBERTLV.der
Commit d7715043a31275fd0ed86407b84d78c240b2fbe4 by laforge
osmo-smdpp: Add more GSMA TS.48 test profiles

We now have all v1, v2, v3, v4 and v5 profiles from
https://github.com/GSMATerminals/Generic-eUICC-Test-Profile-for-Device-Testing-Public

Change-Id: Ia204c055b9d04552ae664130ff8ae4fc4163b88c
The file was addedsmdpp-data/upp/TS48v2_SAIP2.1_BERTLV.der
The file was addedsmdpp-data/upp/TS48v3_SAIP2.3_BERTLV.der
The file was addedsmdpp-data/upp/TS48v3_SAIP2.1_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v2_SAIP2.3_BERTLV.der
The file was addedsmdpp-data/upp/TS48v3_SAIP2.1_BERTLV.der
The file was addedsmdpp-data/upp/TS48v3_SAIP2.3_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v4_SAIP2.3_BERTLV.der
The file was addedsmdpp-data/upp/TS48v5_SAIP2.3_BERTLV_SUCI.der
The file was addedsmdpp-data/upp/TS48v1_B.der
The file was addedsmdpp-data/upp/TS48v1_A.der
The file was addedsmdpp-data/upp/TS48v5_SAIP2.3_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v4_SAIP2.1B_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v4_SAIP2.3_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v5_SAIP2.1B_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v4_SAIP2.1A_NoBERTLV.der
The file was addedsmdpp-data/upp/TS48v5_SAIP2.1A_NoBERTLV.der
Commit 93bdf00967951a8e25665d0f9774bd9fe263892b by laforge
pySim.esim: Add class for parsing/encoding eSIM activation codes

Change-Id: I2256722c04b56e8d9c16a65e3cd94f6a46f4ed85
The file was modifiedpySim/esim/__init__.py
The file was modifiedtests/test_esim.py
Commit 5918345c780cb7561643e0c86ca03cf3edf49068 by laforge
global_platform: implement GET STATUS command

The GlobalPlatform GET STATUS command is used to display information
about ISD / Applications / ExecutabLoad Files / Modules on the card.

Change-Id: Ic92f96c1c6a569aebc93a906c62a43b86fe3b811
The file was modifieddocs/shell.rst
The file was modifiedpySim/global_platform.py
Commit eecef54eee90b2cffc3c73d76648673c4aa3c727 by laforge
commands.py: Wrap the transport send_apdu* methods

Let's not have higher level code directly call the transports send_apdu*
methods.  We do this as a precursor to introducing secure channel
support, where the secure channel driver would add MAC and/or encrypt
APDUs before they are sent to the transport.

Change-Id: I1b870140959aa8241cda2246e74576390123cb2d
The file was modifiedpySim/legacy/cards.py
The file was modifiedpySim/global_platform.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/commands.py
The file was modifiedpySim/euicc.py
Commit a2f16540511e13927c4a334408bf8aa15112a70a by laforge
move global_platform.py to global_platform/__init__.py

This will allow us to have multiple different modules for different
aspects of global_platform.

Change-Id: Ieca0b20c26a2e41eb11455941164474b76eb3c7a
The file was addedpySim/global_platform/__init__.py
The file was removedpySim/global_platform.py
Commit 762a72b3084bfd1cac6cedbe7db0ff4b9420fc7f by laforge
global_platform 'put_key': constrain ranges of KVN + KID in argparse

The earlier we catch errors in user input, the better.

Change-Id: Icee656f1373a993b6883ffaab441fe178c0fe8cb
The file was modifiedpySim/utils.py
The file was modifiedpySim/global_platform/__init__.py
Commit 41a7379a4f5995e0ba5e127776e0cb0b189306a5 by laforge
Introduce GlobalPlatform SCP02 implementation

This implementation of GlobalPlatform SCP02 currently only supports
C-MAC and C-ENC, but no R-MAC or R-ENC yet.

The patch also introduces the notion of having a SCP instance associated
with a SimCardCommands instance.  It also adds the establish_scp0w and
release_scp shell commands to all GlobalPlatform Security Domains.

Change-Id: I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27
The file was modifiedpySim/commands.py
The file was addedtests/test_globalplatform.py
The file was modifieddocs/shell.rst
The file was addedpySim/global_platform/scp02.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/global_platform/__init__.py
The file was addedpySim/secure_channel.py
Commit 321973ad202a897faa61f7b35f62f3d9237b928e by laforge
pySim-shell: Make 'apdu' command use logical (and secure) channel

The 'apdu' command so far bypassed the logical channel and also
the recently-introduced support for secure channels.  Let's change
that, at least by default.  If somebody wants a raw APDU without
secure / logical channel processing, they may use the --raw option.

Change-Id: Id0c364f772c31e11e8dfa21624d8685d253220d0
The file was modifiedpySim-shell.py
Commit 4d5fd25f31d5c50fb22fd7bd3b40d91ac5d74f55 by laforge
global_platform: Add install_for_personalization command

This allows us to perform STORE DATA on applications like ARA-M/ARA-D
after establishing SCP02 to the related security domain.

Change-Id: I2ce766b97bba42c64c4d4492b505be66c24f471e
The file was modifiedpySim/global_platform/__init__.py
The file was modifieddocs/shell.rst
Commit a7eaefc8d9a43b28eda248e13abd560191571561 by laforge
global_platform: add set_status command

Using this command, one can change the life cycle status of on-card
applications, specifically one can LOCK (disable) them and re-enable
them as needed.

Change-Id: Ie14297a119d01cad1284f315a2508aa92cb4633b
The file was modifieddocs/shell.rst
The file was modifiedpySim/global_platform/__init__.py
Commit bdf8419966e2e8e826eed09d35e7a8246300a623 by laforge
global_platform: add delete_key and delete_card_content

This GlobalPlatform command is used to delete applications/load-files
or keys.

Change-Id: Ib5d18e983d0e918633d7c090c54fb9a3384a22e5
The file was modifieddocs/shell.rst
The file was modifiedpySim/global_platform/__init__.py
Commit a30ee172466a56d638766c4f2a701a13610e2c20 by laforge
global_platform: Fix --key-id argument

The key-id is actually a 7-bit integer and on the wire the 8th bit
has a special meaning which can be derived automatically.

Let's unburden the user from explicitly encoding that 8th bit and
instead set it automatically.

Change-Id: I8da37aa8fd064e6d35ed29a70f5d7a0e9060be3a
The file was modifiedpySim/global_platform/__init__.py
Commit afd89ca36de806efdbc4b62c61fcfe8783a784db by laforge
Contstrain argparse integers to permitted range

In many casese we used type=int permitting any integer value, positive
or negative without a constratint in size.  However, in reality often
we're constrained to unsigned 8 or 16 bit ranges.  Let's use the
auto_uint{8,16} functions to enforce this within argparse before
we even try to encode something that won't work.

Change-Id: I35c81230bc18e2174ec1930aa81463f03bcd69c8
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/utils.py
The file was modifiedpySim/ts_102_222.py
Commit 13a1723c2e2e902f08c347f1340fb052fa6d8950 by laforge
rename global_platform.scp02 to global_platform.scp

This is in preparation of extending it to cover SCP03 in a follow-up
patch.

Change-Id: Idc0afac6e95f89ddaf277a89f9c95607e70a471c
The file was addedpySim/global_platform/scp.py
The file was modifiedpySim/global_platform/__init__.py
The file was removedpySim/global_platform/scp02.py
The file was modifiedtests/test_globalplatform.py
Commit af8826a02bc85b47e6568b6c7ba42629cf1ef005 by laforge
Implement Global Platform SCP03

This adds an implementation of the GlobalPlatform SCP03 protocol. It has
been tested in S8 mode for C-MAC, C-ENC, R-MAC and R-ENC with AES using
128, 192 and 256 bit key lengh.  Test vectors generated while talking to
a sysmoEUICC1-C2T are included as unit tests.

Change-Id: Ibc35af5474923aed2e3bcb29c8d713b4127a160d
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/global_platform/scp.py
The file was modifiedtests/test_globalplatform.py
The file was modifieddocs/shell.rst
Commit 57f73f8de79cc872d8cc5abbb82b54b68ab6efbf by laforge
make our tests pass pylint

Change-Id: If3a9f178c3f915123178efe00269fce74f6e585d
The file was modifiedtests/test_globalplatform.py
The file was modifiedtests/test_tlv.py
Commit bc8e2e16640a0bc1084d6fca1981460722452118 by laforge
contrib/jenkins.sh: include tests/*.py in pylint

Change-Id: I9c8113acf5341b198d91040710b6b10cb2b6ef38
The file was modifiedcontrib/jenkins.sh
Commit e55fcf66bf9d5f92dd74858555090767a433e8f8 by laforge
Be more conservative in our imports

Try to avoid '*' from anything into various modules, polluting the
namespace.

Change-Id: Iba749d18e1863ded88ba2d2183e2e8d718b2d612
The file was modifiedpySim/construct.py
The file was modifiedpySim/ts_31_103.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/tlv.py
The file was modifiedpySim/apdu/ts_102_221.py
Commit cd8e16fdfec03b4124e5087930b4dc7cdb668826 by laforge
global_platform: KCV support for PUT KEY

GlobalPlatform requires the use of the KCV for DES + AES keys. Let's
implement that.

(11.8.2.3.3: "For all key types described in section B.6, the Key Check
Value shall be present.")

Change-Id: Ief168a66dee58b56f4126db12829b3a98906c8db
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedtests/test_globalplatform.py
Commit 7156a40187325259a023312747d4c55ec530747e by laforge
construct: Add StripTrailerAdapter

In smart cards, we every so often encounter data types that contain a
bit-mask whose length depends on whether or not there are any of the
least-significant bits are set.  So far we worked around this with
some kind of Struct('byte1', 'byte2'/COptional, 'byte3'/COptional)
approach.

Let's do thisin a generic way using the new StripTrailerAdapter.

Change-Id: I659aa7247c57c680895b0bf8412f9e477fc3587d
The file was modifiedtests/test_construct.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/construct.py
Commit 2bb2ff4aebf3d5ccfa375768c5190c7a306de2f2 by laforge
global_platform: INSTALL [for install] support

Change-Id: I4c1da90f1aa8ad9609602272f374078d1e1faa11
The file was modifieddocs/shell.rst
The file was modifiedpySim/global_platform/__init__.py
Commit 62bd7d3df231022f8f8889f021ff7c1be27a3427 by laforge
global_platform: Add DEK (key) encryption support

Change-Id: I940cc2e16a1d3e3cdef4ebcf3f15fc2c8de21284
The file was modifiedpySim/global_platform/scp.py
The file was modifiedpySim/global_platform/__init__.py
Commit 0f2ac70397bba762c134e53e8c893f6796af607a by laforge
pylint: card_key_provider.py, card_handler.py, iso7816_4.py, jsonpath.py

pySim/card_key_provider.py:57:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/card_key_provider.py:61:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)

pySim/card_handler.py:100:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
pySim/card_handler.py:100:24: C0121: Comparison 'self.cmds.get('verbose') == True' should be 'self.cmds.get('verbose') is True' if checking for the singleton value True, or 'bool(self.cmds.get('verbose'))' if testing for truthiness (singleton-comparison)
pySim/card_handler.py:29:0: C0411: standard import "import subprocess" should be placed before "from pySim.transport import LinkBase" (wrong-import-order)
pySim/card_handler.py:30:0: C0411: standard import "import sys" should be placed before "from pySim.transport import LinkBase" (wrong-import-order)
pySim/card_handler.py:31:0: C0411: third party import "import yaml" should be placed before "from pySim.transport import LinkBase" (wrong-import-order)

pySim/iso7816_4.py:20:0: W0401: Wildcard import construct (wildcard-import)

pySim/jsonpath.py:1:0: C0114: Missing module docstring (missing-module-docstring)
pySim/jsonpath.py:6:0: W0105: String statement has no effect (pointless-string-statement)
pySim/jsonpath.py:2:0: W0611: Unused import json (unused-import)
pySim/jsonpath.py:3:0: W0611: Unused import pprint (unused-import)

Change-Id: I780595d69000f727ad0fbaff4b89918b91b3122e
The file was modifiedpySim/jsonpath.py
The file was modifiedpySim/iso7816_4.py
The file was modifiedpySim/card_handler.py
The file was modifiedpySim/card_key_provider.py
Commit f57912ea15f16d1b24d51b616871555f81234c1e by laforge
pylint: gsmtap.py

pySim/gsmtap.py:28:0: W0401: Wildcard import construct (wildcard-import)
pySim/gsmtap.py:26:0: W0611: Unused List imported from typing (unused-import)
pySim/gsmtap.py:26:0: W0611: Unused Dict imported from typing (unused-import)
pySim/gsmtap.py:26:0: W0611: Unused Optional imported from typing (unused-import)

Change-Id: I53739874edef0a9ae25a8599e7cc7eee9dedb703
The file was modifiedpySim/gsmtap.py
Commit c5c97281273c02a24464fe152915266d47de2920 by laforge
pylint: cards.py

pySim/cards.py:30:0: W0401: Wildcard import pySim.utils (wildcard-import)
pySim/cards.py:41:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/cards.py:55:4: R1711: Useless return at end of function or method (useless-return)
pySim/cards.py:78:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
pySim/cards.py:91:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
pySim/cards.py:159:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/cards.py:28:0: C0411: standard import "import abc" should be placed before "from pySim.ts_102_221 import EF_DIR" (wrong-import-order)
pySim/cards.py:25:0: W0611: Unused Dict imported from typing (unused-import)
pySim/cards.py:28:0: W0611: Unused import abc (unused-import)

Change-Id: I708da28caffb417ed2f8413f9611526b18b29cd4
The file was modifiedpySim/cards.py
Commit cb4c0cf1e8e8e4cf989bf2d50eccab55683f1211 by laforge
pylint: exceptions.py

pySim/exceptions.py:27:4: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/exceptions.py:32:4: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/exceptions.py:37:4: W0107: Unnecessary pass statement (unnecessary-pass)

Change-Id: Ibd0725ceb5fdcdc0995c39a4449ada2fd6088552
The file was modifiedpySim/exceptions.py
Commit 8e7d28cad725fd393ff4a16d5c80f684502dea0e by laforge
pylint: ota.py

pySim/ota.py:21:0: W0401: Wildcard import construct (wildcard-import)
pySim/ota.py:129:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/ota.py:150:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/ota.py:192:8: W0612: Unused variable 'padded_data' (unused-variable)
pySim/ota.py:202:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/ota.py:207:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/ota.py:210:4: C0103: Method name "fromKeyset" doesn't conform to snake_case naming style (invalid-name)
pySim/ota.py:239:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/ota.py:242:4: C0103: Method name "fromKeyset" doesn't conform to snake_case naming style (invalid-name)
pySim/ota.py:328:4: W0221: Number of parameters was 4 in 'OtaDialect.encode_cmd' and is now 5 in overriding 'OtaDialectSms.encode_cmd' method (arguments-differ)
pySim/ota.py:392:4: W0221: Number of parameters was 3 in 'OtaDialect.decode_resp' and is now 4 in overriding 'OtaDialectSms.decode_resp' method (arguments-differ)

Change-Id: Icb8d690e541dbaf1406085a8446a0c67641fefff
The file was modifiedpySim/ota.py
Commit e8439d96394ca1d2b4273182968f23d652a6497e by laforge
pylint: sms.py

pySim/sms.py:23:0: W0404: Reimport 'Flag' (imported line 23) (reimported)
pySim/sms.py:54:4: C0103: Method name "fromBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:60:4: C0103: Method name "toBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:120:4: C0103: Method name "fromBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:132:4: C0103: Method name "fromSmpp" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:137:4: C0103: Method name "toSmpp" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:141:4: C0103: Method name "toBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:188:4: C0103: Method name "fromBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:192:8: W0612: Unused variable 'flags' (unused-variable)
pySim/sms.py:209:4: C0103: Method name "toBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:228:4: C0103: Method name "fromSmpp" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:236:4: C0103: Method name "fromSmppSubmit" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:279:4: C0103: Method name "fromBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:306:12: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/sms.py:311:12: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/sms.py:319:4: C0103: Method name "toBytes" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:339:4: C0103: Method name "fromSmpp" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:347:4: C0103: Method name "fromSmppSubmit" doesn't conform to snake_case naming style (invalid-name)
pySim/sms.py:373:4: C0103: Method name "toSmpp" doesn't conform to snake_case naming style (invalid-nam

Change-Id: I8082a01443ef568eebda696239572f0af7b56f1b
The file was modifiedtests/test_ota.py
The file was modifiedpySim/sms.py
The file was modifiedtests/test_sms.py
The file was modifiedpySim/ota.py
Commit 33cd964c1aed01f3856e4bccf48478963289c559 by laforge
pylint: profile.py

pySim/profile.py:169:0: C0325: Unnecessary parens after 'assert' keyword (superfluous-parens)
pySim/profile.py:189:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/profile.py:197:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/profile.py:27:0: C0411: standard import "import abc" should be placed before "from pySim.commands import SimCardCommands" (wrong-import-order)
pySim/profile.py:28:0: C0411: standard import "import operator" should be placed before "from pySim.commands import SimCardCommands" (wrong-import-order)
pySim/profile.py:29:0: C0411: standard import "from typing import List" should be placed before "from pySim.commands import SimCardCommands" (wrong-import-order)

Change-Id: Ifd55e8ab5ab04da06c8d11e50bc15740580b2900
The file was modifiedpySim/profile.py
Commit eb18ed08b075797618fb74d5c748b1d12ead9028 by laforge
pylint: ts_31_102_telecom.py

pySim/ts_31_102_telecom.py:45:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
pySim/ts_31_102_telecom.py:33:0: W0401: Wildcard import construct (wildcard-import)
pySim/ts_31_102_telecom.py:76:15: C0121: Comparison 'in_json[srv]['activated'] == True' should be 'in_json[srv]['activated'] is True' if checking for the singleton value True, or 'in_json[srv]['activated']' if testing for truthiness (singleton-comparison)
pySim/ts_31_102_telecom.py:85:23: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_31_102_telecom.py:124:22: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_31_102_telecom.py:32:0: C0411: third party import "from construct import Optional as COptional" should be placed before "from pySim.tlv import *" (wrong-import-order)
pySim/ts_31_102_telecom.py:33:0: C0411: third party import "from construct import *" should be placed before "from pySim.tlv import *" (wrong-import-order)

Change-Id: I4ee0d0e1b5b418b8527b4674141cbaef896a64a2
The file was modifiedpySim/ts_31_102_telecom.py
Commit 6088b554ef12a0bba28f1f43adcc961c53435851 by laforge
pylint: app.py

pySim/app.py:113:0: C0305: Trailing newlines (trailing-newlines)
pySim/app.py:23:0: W0611: Unused NoCardError imported from pySim.exceptions (unused-import)

Change-Id: I3cac6892f4d3da66f116cecd49f751da227528a4
The file was modifiedpySim/app.py
Commit fd9188d306365e9063bf83a2ff21c06873fe3a31 by laforge
pylint: cat.py

pySim/cat.py:586:4: W0237: Parameter 'do' has been renamed to 'x' in overriding 'PlmnWactList._from_bytes' method (arguments-renamed)
pySim/cat.py:981:8: W0120: Else clause on loop without a break statement, remove the else and de-indent all the code inside it (useless-else-on-loop)
pySim/cat.py:1000:4: W0221: Number of parameters was 3 in 'TLV_IE_Collection.from_bytes' and is now 2 in overriding 'ProactiveCommand.from_bytes' method (arguments-differ)
pySim/cat.py:1010:12: W0612: Unused variable 'dec' (unused-variable)
pySim/cat.py:1010:17: W0612: Unused variable 'remainder' (unused-variable)
pySim/cat.py:1022:4: W0221: Number of parameters was 2 in 'TLV_IE_Collection.to_bytes' and is now 1 in overriding 'ProactiveCommand.to_bytes' method (arguments-differ)
pySim/cat.py:22:0: C0411: standard import "from typing import List" should be placed before "from bidict import bidict" (wrong-import-order)
pySim/cat.py:26:0: C0411: third party import "from construct import Int8ub, Int16ub, Byte, Bytes, Bit, Flag, BitsInteger" should be placed before "from pySim.utils import b2h, h2b, dec_xplmn_w_act" (wrong-import-order)
pySim/cat.py:27:0: C0411: third party import "from construct import Struct, Enum, Tell, BitStruct, this, Padding, RepeatUntil" should be placed before "from pySim.utils import b2h, h2b, dec_xplmn_w_act" (wrong-import-order)
pySim/cat.py:28:0: C0411: third party import "from construct import GreedyBytes, Switch, GreedyRange, FlagsEnum" should be placed before "from pySim.utils import b2h, h2b, dec_xplmn_w_act" (wrong-import-order)
pySim/cat.py:23:0: W0611: Unused h2b imported from pySim.utils (unused-import)
pySim/cat.py:26:0: W0611: Unused Bit imported from construct (unused-import)
pySim/cat.py:26:0: W0611: Unused Flag imported from construct (unused-import)
pySim/cat.py:27:0: W0611: Unused Tell imported from construct (unused-import)
pySim/cat.py:27:0: W0611: Unused Padding imported from construct (unused-import)
pySim/cat.py:27:0: W0611: Unused RepeatUntil imported from construct (unused-import)

Change-Id: I0c6327a7a8045736e8678b7286a7ed685c96fb71
The file was modifiedpySim/cat.py
Commit f5a8e70f44acafc0d46fe573d5780471e04363d8 by laforge
pylint: gsm_r.py

pySim/gsm_r.py:97:0: W0311: Bad indentation. Found 11 spaces, expected 12 (bad-indentation)
pySim/gsm_r.py:32:0: C0411: standard import "from struct import pack, unpack" should be placed before "from pySim.utils import *" (wrong-import-order)
pySim/gsm_r.py:33:0: C0411: third party import "from construct import Struct, Bytes, Int8ub, Int16ub, Int24ub, Int32ub, FlagsEnum" should be placed before "from pySim.utils import *" (wrong-import-order)
pySim/gsm_r.py:34:0: C0411: third party import "from construct import Optional as COptional" should be placed before "from pySim.utils import *" (wrong-import-order)
pySim/gsm_r.py:35:0: C0412: Imports from package pySim are not grouped (ungrouped-imports)
pySim/gsm_r.py:30:0: W0611: Unused import enum (unused-import)
pySim/gsm_r.py:32:0: W0611: Unused pack imported from struct (unused-import)
pySim/gsm_r.py:32:0: W0611: Unused unpack imported from struct (unused-import)
pySim/gsm_r.py:39:0: W0611: Unused import pySim.ts_51_011 (unused-import)

Change-Id: I2a3bba5994d0d4d90fcd3f51bee962fec3a8b0dc
The file was modifiedpySim/gsm_r.py
Commit c4d80870e88605eaf754802815859f3ad1b5a02c by laforge
pylint: transport/calypso.py

pySim/transport/calypso.py:27:0: W0401: Wildcard import pySim.exceptions (wildcard-import)
pySim/transport/calypso.py:61:23: W0622: Redefining built-in 'type' (redefined-builtin)
pySim/transport/calypso.py:62:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
pySim/transport/calypso.py:73:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
pySim/transport/calypso.py:27:0: W0614: Unused import(s) NoCardError and SwMatchError from wildcard import of pySim.exceptions (unused-wildcard-import)

Change-Id: I6b10d5f3370c00b07288300b537c6f0e17c84a87
The file was modifiedpySim/transport/calypso.py
Commit 181becb676f5a769eb67cd7d05b45d5bdb10e400 by laforge
pylint: transport/modem_atcmd.py

pySim/transport/modem_atcmd.py:70:0: C0325: Unnecessary parens after 'assert' keyword (superfluous-parens)
pySim/transport/modem_atcmd.py:28:0: W0401: Wildcard import pySim.exceptions (wildcard-import)
pySim/transport/modem_atcmd.py:60:22: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/transport/modem_atcmd.py:72:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise ReaderError('Failed to send AT command: %s' % cmd) from exc' (raise-missing-from)
pySim/transport/modem_atcmd.py:120:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/transport/modem_atcmd.py:138:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
pySim/transport/modem_atcmd.py:170:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise ReaderError('Failed to parse response from modem: %s' % rsp) from exc' (raise-missing-from)
pySim/transport/modem_atcmd.py:168:13: W0612: Unused variable 'rsp_pdu_len' (unused-variable)
pySim/transport/modem_atcmd.py:21:0: C0411: standard import "import time" should be placed before "import serial" (wrong-import-order)
pySim/transport/modem_atcmd.py:22:0: C0411: standard import "import re" should be placed before "import serial" (wrong-import-order)
pySim/transport/modem_atcmd.py:23:0: C0411: standard import "import argparse" should be placed before "import serial" (wrong-import-order)
pySim/transport/modem_atcmd.py:24:0: C0411: standard import "from typing import Optional" should be placed before "import serial" (wrong-import-order)
pySim/transport/modem_atcmd.py:28:0: W0614: Unused import(s) NoCardError and SwMatchError from wildcard import of pySim.exceptions (unused-wildcard-import)

Change-Id: I2c8994eabd973b65132af1030429b1021d0c20df
The file was modifiedpySim/transport/modem_atcmd.py
Commit 7781c70c09689d2ccfea11d20931a2eff9da2a5f by laforge
pylint: transport/pcsc.py

pySim/transport/pcsc.py:26:0: W0404: Reimport 'CardConnectionException' (imported line 26) (reimported)
pySim/transport/pcsc.py:60:4: R1711: Useless return at end of function or method (useless-return)
pySim/transport/pcsc.py:74:12: W0707: Consider explicitly re-raising using 'except CardRequestTimeoutException as exc' and 'raise NoCardError() from exc' (raise-missing-from)
pySim/transport/pcsc.py:86:12: W0707: Consider explicitly re-raising using 'except CardConnectionException as exc' and 'raise ProtocolError() from exc' (raise-missing-from)
pySim/transport/pcsc.py:88:12: W0707: Consider explicitly re-raising using 'except NoCardException as exc' and 'raise NoCardError() from exc' (raise-missing-from)
pySim/transport/pcsc.py:22:0: W0611: Unused Union imported from typing (unused-import)

Change-Id: I0ef440d8825300d6efb8959a67da095ab5623f9c
The file was modifiedpySim/transport/pcsc.py
Commit fdaefd9a8a8f0496cce40baeafd5ddd6a66bccca by laforge
pylint: transport/serial.py

pySim/transport/serial.py:54:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/transport/serial.py:89:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/transport/serial.py:225:0: C0325: Unnecessary parens after 'while' keyword (superfluous-parens)
pySim/transport/serial.py:63:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/transport/serial.py:106:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
pySim/transport/serial.py:124:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise ValueError('Invalid reset pin %s' % self._rst_pin) from exc' (raise-missing-from)
pySim/transport/serial.py:204:12: R1723: Unnecessary "elif" after "break", remove the leading "el" from "elif" (no-else-break)
pySim/transport/serial.py:20:0: C0411: standard import "import time" should be placed before "import serial" (wrong-import-order)
pySim/transport/serial.py:21:0: C0411: standard import "import os" should be placed before "import serial" (wrong-import-order)
pySim/transport/serial.py:22:0: C0411: standard import "import argparse" should be placed before "import serial" (wrong-import-order)
pySim/transport/serial.py:23:0: C0411: standard import "from typing import Optional" should be placed before "import serial" (wrong-import-order)

Change-Id: I82ef12492615a18a13cbdecf0371b3a5d02bbd5c
The file was modifiedpySim/transport/serial.py
Commit 49d69335b24c6fa1d2553daa5f7f4cf4425ea0eb by laforge
pylint: transport/__init__.py

pySim/transport/__init__.py:139:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)

Change-Id: Ibeeb7d6fde40bb37774bbd09ad185203ac7bcb48
The file was modifiedpySim/transport/__init__.py
Commit c5ff0a6ab57156f88d9728fb49a2450408f6c4e9 by laforge
pylint: apdu_source/__init__.py

pySim/apdu_source/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
pySim/apdu_source/__init__.py:17:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/apdu_source/__init__.py:34:16: W0133: Exception statement has no effect (pointless-exception-statement)

Change-Id: Iec552afd6004b849132132642910a4c7f91e3473
The file was modifiedpySim/apdu_source/__init__.py
Commit 528d9225100724a928b71d2974775adc8754fd89 by laforge
pylint: apdu_source/gsmtap.py

pySim/apdu_source/gsmtap.py:48:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/apdu_source/gsmtap.py:44:20: W0612: Unused variable 'addr' (unused-variable)
pySim/apdu_source/gsmtap.py:22:0: C0411: first party import "from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order)
pySim/apdu_source/gsmtap.py:23:0: C0411: first party import "from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order)
pySim/apdu_source/gsmtap.py:24:0: C0411: first party import "from pySim.apdu.global_platform import ApduCommands as GpApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order)
pySim/apdu_source/gsmtap.py:19:0: W0611: Unused GsmtapMessage imported from pySim.gsmtap (unused-import)

Change-Id: I672e8838ebe11015863fd4fd6047181a3f184658
The file was modifiedpySim/apdu_source/gsmtap.py
Commit 9bc016e7770fa774695ad35fe8390d85ccc5a755 by laforge
pylint: apdu_source/pyshark_gsmtap

pySim/apdu_source/pyshark_gsmtap.py:90:0: C0305: Trailing newlines (trailing-newlines)
pySim/apdu_source/pyshark_gsmtap.py:68:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/apdu_source/pyshark_gsmtap.py:30:0: C0411: first party import "from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order)
pySim/apdu_source/pyshark_gsmtap.py:31:0: C0411: first party import "from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order)
pySim/apdu_source/pyshark_gsmtap.py:32:0: C0411: first party import "from pySim.apdu.global_platform import ApduCommands as GpApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order)
pySim/apdu_source/pyshark_gsmtap.py:19:0: W0611: Unused import sys (unused-import)
pySim/apdu_source/pyshark_gsmtap.py:21:0: W0611: Unused pprint imported from pprint as pp (unused-import)
pySim/apdu_source/pyshark_gsmtap.py:25:0: W0611: Unused b2h imported from pySim.utils (unused-import)
pySim/apdu_source/pyshark_gsmtap.py:26:0: W0611: Unused Tpdu imported from pySim.apdu (unused-import)

Change-Id: I0f2bfed2f671e02fc48bcc2a03c785edc691584f
The file was modifiedpySim/apdu_source/pyshark_gsmtap.py
Commit 295d4a490707c459c726374f6ee0da8afb5ec514 by laforge
pylint: apdu_source/pyshark_rspro

pySim/apdu_source/pyshark_rspro.py:19:0: W0611: Unused import sys (unused-import)
pySim/apdu_source/pyshark_rspro.py:21:0: W0611: Unused pprint imported from pprint as pp (unused-import)
pySim/apdu_source/pyshark_rspro.py:25:0: W0611: Unused b2h imported from pySim.utils (unused-import)

Change-Id: Ibe8482d8adbb82a74f36b0d64bc5dae27da02b73
The file was modifiedpySim/apdu_source/pyshark_rspro.py
Commit 0930bcbbb7923acff5587afdfee3d0ee2416e4ec by laforge
pylint: apdu/ts_31_102.py

pySim/apdu/ts_31_102.py:12:0: W0401: Wildcard import construct (wildcard-import)
pySim/apdu/ts_31_102.py:38:0: W0404: Reimport 'ApduCommand' (imported line 18) (reimported)
pySim/apdu/ts_31_102.py:38:0: W0404: Reimport 'ApduCommandSet' (imported line 18) (reimported)

Change-Id: I191147af95142adcd7d768d7dae6480b0c7513fc
The file was modifiedpySim/apdu/ts_31_102.py
Commit 9ef65099d26008c631d33dd4dd217e0808052962 by laforge
pylint: apdu/__init__.py

pySim/apdu/__init__.py:41:0: W0105: String statement has no effect (pointless-string-statement)
pySim/apdu/__init__.py:55:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument)
pySim/apdu/__init__.py:187:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/apdu/__init__.py:200:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:208:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:216:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:224:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:239:11: C0117: Consider changing "not 'p1' in self.cmd_dict" to "'p1' not in self.cmd_dict" (unnecessary-negation)
pySim/apdu/__init__.py:295:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:313:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:416:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:429:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:455:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/__init__.py:31:0: C0411: standard import "import typing" should be placed before "from termcolor import colored" (wrong-import-order)
pySim/apdu/__init__.py:32:0: C0411: standard import "from typing import List, Dict, Optional" should be placed before "from termcolor import colored" (wrong-import-order)

Change-Id: I5657912df474f3ed0e277458a8eb33e28aeb2927
The file was modifiedpySim/apdu/__init__.py
Commit e6e74229c9bba2f6eebe118a2f4626e9f4110dd1 by laforge
pylint: pySim/esim/bsp.py

pySim/esim/bsp.py:1:0: C0114: Missing module docstring (missing-module-docstring)
pySim/esim/bsp.py:28:0: C0413: Import "import abc" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:29:0: C0413: Import "from typing import List" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:30:0: C0413: Import "import logging" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:33:0: C0413: Import "from cryptography.hazmat.primitives import hashes" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:34:0: C0413: Import "from cryptography.hazmat.primitives.kdf.x963kdf import X963KDF" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:36:0: C0413: Import "from Cryptodome.Cipher import AES" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:37:0: C0413: Import "from Cryptodome.Hash import CMAC" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:39:0: C0413: Import "from pySim.utils import bertlv_encode_len, bertlv_parse_one, b2h" should be placed at the top of the module (wrong-import-position)
pySim/esim/bsp.py:48:55: W0613: Unused argument 'padding' (unused-argument)
pySim/esim/bsp.py:55:45: W0613: Unused argument 'multiple' (unused-argument)
pySim/esim/bsp.py:84:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/esim/bsp.py:89:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/esim/bsp.py:94:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/esim/bsp.py:169:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/esim/bsp.py:292:8: W0612: Unused variable 'tdict' (unused-variable)
pySim/esim/bsp.py:292:15: W0612: Unused variable 'l' (unused-variable)
pySim/esim/bsp.py:292:23: W0612: Unused variable 'remain' (unused-variable)

Change-Id: I64bd634606c375e767676a4b5ba7c2cc042350c2
The file was modifiedpySim/esim/bsp.py
Commit f235b799e96f2ac07dfcbb8de4a0a9be62952599 by laforge
pylint: esim/x509_cert.py

pySim/esim/x509_cert.py:70:4: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/esim/x509_cert.py:91:20: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/esim/x509_cert.py:105:28: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
pySim/esim/x509_cert.py:163:0: C0413: Import "from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature" should be placed at the top of the module (wrong-import-position)
pySim/esim/x509_cert.py:20:0: C0411: standard import "from typing import Optional, List" should be placed before "import requests" (wrong-import-order)
pySim/esim/x509_cert.py:163:0: C0411: third party import "from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature" should be placed before "from pySim.utils import b2h" (wrong-import-order)
pySim/esim/x509_cert.py:163:0: C0412: Imports from package cryptography are not grouped (ungrouped-imports)
pySim/esim/x509_cert.py:22:0: W0611: Unused padding imported from cryptography.hazmat.primitives.asymmetric (unused-import)
pySim/esim/x509_cert.py:24:0: W0611: Unused InvalidSignature imported from cryptography.exceptions (unused-import)

Change-Id: Ic435c9a7cfcc18cacec3a3d872925bd737fb5cd9
The file was modifiedpySim/esim/x509_cert.py
Commit 2b84644c0827b3a0511d6c4078d32689c044dac2 by laforge
pylint: esim/rsp.py

pySim/esim/rsp.py:101:4: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/esim/rsp.py:27:0: C0411: standard import "from collections.abc import MutableMapping" should be placed before "from cryptography.hazmat.primitives.asymmetric import ec" (wrong-import-order)
pySim/esim/rsp.py:22:0: W0611: Unused import copyreg (unused-import)
pySim/esim/rsp.py:27:0: W0611: Unused MutableMapping imported from collections.abc (unused-import)

Change-Id: Id87dbf82cd41ce6e5276e5bdd7af1877d77e3fab
The file was modifiedpySim/esim/rsp.py
Commit 1258e464a1ac50c9eb32ea1d532f0d22c764af66 by laforge
pylint: esim/saip/personalization.py

pySim/esim/saip/personalization.py:104:0: W0311: Bad indentation. Found 17 spaces, expected 16 (bad-indentation)
pySim/esim/saip/personalization.py:105:0: W0311: Bad indentation. Found 17 spaces, expected 16 (bad-indentation)
pySim/esim/saip/personalization.py:151:0: C0305: Trailing newlines (trailing-newlines)
pySim/esim/saip/personalization.py:36:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument)
pySim/esim/saip/personalization.py:56:4: W0237: Parameter 'pe_seq' has been renamed to 'pes' in overriding 'Iccid.apply' method (arguments-renamed)
pySim/esim/saip/personalization.py:19:0: W0611: Unused Optional imported from typing (unused-import)

Change-Id: I70b3e266bbafabbfcec3d48027d50b45c2c17809
The file was modifiedpySim/esim/saip/personalization.py
Commit 5f6b64dc2591ee4fb47c31d2aa4cfc5fbbad9761 by laforge
pylint: esim/saip/templates.py

pySim/esim/saip/templates.py:106:0: R1707: Disallow trailing comma tuple (trailing-comma-tuple)
pySim/esim/saip/templates.py:56:37: C0121: Comparison 'self.fid != None' should be 'self.fid is not None' (singleton-comparison)
pySim/esim/saip/templates.py:57:28: C0121: Comparison 'self.arr != None' should be 'self.arr is not None' (singleton-comparison)
pySim/esim/saip/templates.py:58:37: C0121: Comparison 'self.sfi != None' should be 'self.sfi is not None' (singleton-comparison)
pySim/esim/saip/templates.py:96:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/esim/saip/templates.py:591:0: W1404: Implicit string concatenation found in list (implicit-str-concat)

Change-Id: I181578ba630c8bdb558297e990411b59593652a0
The file was modifiedpySim/esim/saip/templates.py
Commit 530bf73cbcd7af3bfdf957d22e13690de935dc1a by laforge
pylint: esim/saip/oid.py

pySim/esim/saip/oid.py:30:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/esim/saip/oid.py:46:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)

Change-Id: I65c9cd1bb2b6a1747a7fbb25052adc75605bc870
The file was modifiedpySim/esim/saip/oid.py
Commit 4c0b80415ea9f19f07600923db862952f63642c3 by laforge
pylint: global_platform/scp.py

pySim/global_platform/scp.py:27:0: W0404: Reimport 'Optional' (imported line 20) (reimported)
pySim/global_platform/scp.py:157:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/global_platform/scp.py:165:8: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/global_platform/scp.py:182:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/global_platform/scp.py:189:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/global_platform/scp.py:266:4: W0221: Variadics removed in overriding 'SCP02._wrap_cmd_apdu' method (arguments-differ)
pySim/global_platform/scp.py:298:4: W0237: Parameter 'rsp_apdu' has been renamed to 'apdu' in overriding 'SCP02.unwrap_rsp_apdu' method (arguments-renamed)
pySim/global_platform/scp.py:314:7: C0121: Comparison 'l == None' should be 'l is None' (singleton-comparison)
pySim/global_platform/scp.py:436:11: C0121: Comparison 'host_challenge == None' should be 'host_challenge is None' (singleton-comparison)
pySim/global_platform/scp.py:506:4: W0237: Parameter 'rsp_apdu' has been renamed to 'apdu' in overriding 'SCP03.unwrap_rsp_apdu' method (arguments-renamed)
pySim/global_platform/scp.py:27:0: C0411: standard import "from typing import Optional" should be placed before "from Cryptodome.Cipher import DES3, DES" (wrong-import-order)

Change-Id: Idd2b779a6628c88d9a48c94b8581525209824426
The file was modifiedpySim/global_platform/scp.py
Commit 4f3976d77f53967c17ff5e173641970ecc83d5db by laforge
pylint: cdma_ruim.py

pySim/cdma_ruim.py:30:0: W0401: Wildcard import construct (wildcard-import)
pySim/cdma_ruim.py:188:4: W0237: Parameter 'data_hex' has been renamed to 'resp_hex' in overriding 'CardProfileRUIM.decode_select_response' method (arguments-renamed)
pySim/cdma_ruim.py:30:0: C0411: third party import "from construct import *" should be placed before "from pySim.utils import *" (wrong-import-order)

Change-Id: I4c384f37a6a317c6eddef8742572fcfa76a5fc20
The file was modifiedpySim/cdma_ruim.py
Commit 0d9c8f73a8225ec08b394a9ad596389db0072424 by laforge
pylint: sysmocom_sja2.py

pySim/sysmocom_sja2.py:20:0: W0401: Wildcard import pytlv.TLV (wildcard-import)
pySim/sysmocom_sja2.py:27:0: W0401: Wildcard import construct (wildcard-import)
pySim/sysmocom_sja2.py:21:0: C0411: standard import "from struct import pack, unpack" should be placed before "from pytlv.TLV import *" (wrong-import-order)
pySim/sysmocom_sja2.py:27:0: C0411: third party import "from construct import *" should be placed before "from pySim.utils import *" (wrong-import-order)
pySim/sysmocom_sja2.py:21:0: W0611: Unused pack imported from struct (unused-import)
pySim/sysmocom_sja2.py:25:0: W0611: Unused CardProfileUICC imported from pySim.ts_102_221 (unused-import)

Change-Id: I0e5b5c6f3179f9710464af4cba91d682412b8a09
The file was modifiedpySim/sysmocom_sja2.py
Commit 4b56c6cd3e494fc566deb187d8ab866e5998a0ff by laforge
pylint: ts_31_102.py

Change-Id: I5b72ad476d338aa4048bb15a74796ef69191f028
The file was modifiedpySim/ts_31_102.py
Commit a5630dc45c23d395144728c522c59af496864dc3 by laforge
pylint: apdu/ts_102_221.py

pySim/apdu/ts_102_221.py:60:16: R1724: Unnecessary "else" after "continue", remove the "else" and de-indent the code inside it (no-else-continue)
pySim/apdu/ts_102_221.py:107:16: W0107: Unnecessary pass statement (unnecessary-pass)
pySim/apdu/ts_102_221.py:294:8: R1703: The if statement can be replaced with 'return bool(test)' (simplifiable-if-statement)
pySim/apdu/ts_102_221.py:294:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/ts_102_221.py:299:31: W0613: Unused argument 'lchan' (unused-argument)
...
pySim/apdu/ts_102_221.py:389:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/apdu/ts_102_221.py:421:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/apdu/ts_102_221.py:425:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/apdu/ts_102_221.py:438:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/apdu/ts_102_221.py:26:0: C0411: standard import "from typing import Optional, Dict, Tuple" should be placed before "from construct import GreedyRange, Struct" (wrong-import-order)

Change-Id: Id5caac8da4c965dbaf88d624cdc9dcc8fc168b8c
The file was modifiedpySim/apdu/ts_102_221.py
Commit a5fafe8b4857cbecb1bce8b47df2acf5712216d7 by laforge
pylint: ts_102_221.py

pySim/ts_102_221.py:20:0: W0622: Redefining built-in 'BlockingIOError' (redefined-builtin)
pySim/ts_102_221.py:30:0: R0402: Use 'from pySim import iso7816_4' instead (consider-using-from-import)
pySim/ts_102_221.py:20:0: W0401: Wildcard import construct (wildcard-import)
pySim/ts_102_221.py:235:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/ts_102_221.py:272:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/ts_102_221.py:281:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/ts_102_221.py:484:12: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple)
pySim/ts_102_221.py:486:12: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple)
pySim/ts_102_221.py:488:12: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple)
pySim/ts_102_221.py:523:11: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)
pySim/ts_102_221.py:647:0: W0613: Unused argument 'kwargs' (unused-argument)
pySim/ts_102_221.py:747:19: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_221.py:26:0: C0411: third party import "from bidict import bidict" should be placed before "from pySim.construct import *" (wrong-import-order)
pySim/ts_102_221.py:27:0: C0412: Imports from package pySim are not grouped (ungrouped-imports)
pySim/ts_102_221.py:29:0: W0611: Unused match_sim imported from pySim.profile (unused-import)
pySim/ts_102_221.py:34:0: W0611: Unused DF_GSM imported from pySim.ts_51_011 (unused-import)
pySim/ts_102_221.py:34:0: W0611: Unused DF_TELECOM imported from pySim.ts_51_011 (unused-import)

Change-Id: I99d408bdf2551527f097a04240e857728b738621
The file was modifiedpySim/ts_102_221.py
Commit f01c4b2c989999bde8c16ea0b572884b193fd16f by laforge
pylint: ara_m.py

pySim/ara_m.py:29:0: W0622: Redefining built-in 'BlockingIOError' (redefined-builtin)
pySim/ara_m.py:29:0: W0401: Wildcard import construct (wildcard-import)
pySim/ara_m.py:68:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/ara_m.py:89:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/ara_m.py:282:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/ara_m.py:280:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ara_m.py:312:34: W0613: Unused argument 'opts' (unused-argument)
pySim/ara_m.py:318:37: W0613: Unused argument 'opts' (unused-argument)
pySim/ara_m.py:356:15: C0121: Comparison 'opts.aid != None' should be 'opts.aid is not None' (singleton-comparison)
pySim/ara_m.py:385:37: W0613: Unused argument 'opts' (unused-argument)
pySim/ara_m.py:309:8: W0238: Unused private member `AddlShellCommands.__init(self)` (unused-private-member)
pySim/ara_m.py:309:8: W0238: Unused private member `ADF_ARAM.AddlShellCommands.__init(self)` (unused-private-member)

Change-Id: I5a739187a8966cdb0ae5c6cbc7bc5d4115433aeb
The file was modifiedpySim/ara_m.py
Commit 356a6c0f99109dec7e0e1c07755deb55dc00fa2e by laforge
pylint: runtime.py

pySim/runtime.py:272:0: C0325: Unnecessary parens after 'raise' keyword (superfluous-parens)
pySim/runtime.py:276:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/runtime.py:280:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/runtime.py:349:0: C0325: Unnecessary parens after 'raise' keyword (superfluous-parens)
pySim/runtime.py:549:0: C0305: Trailing newlines (trailing-newlines)
pySim/runtime.py:29:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/runtime.py:119:16: W0612: Unused variable 'data' (unused-variable)
pySim/runtime.py:153:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/runtime.py:161:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/runtime.py:212:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/runtime.py:273:12: W0707: Consider explicitly re-raising using 'raise RuntimeError('%s: %s - %s' % (swm.sw_actual, k[0], k[1])) from swm' (raise-missing-from)
pySim/runtime.py:267:19: W0612: Unused variable 'sw' (unused-variable)
pySim/runtime.py:343:27: W0612: Unused variable 'sw' (unused-variable)
pySim/runtime.py:397:15: W0612: Unused variable 'sw' (unused-variable)
pySim/runtime.py:527:14: W0612: Unused variable 'sw' (unused-variable)
pySim/runtime.py:528:8: W0612: Unused variable 'tag' (unused-variable)
pySim/runtime.py:528:13: W0612: Unused variable 'length' (unused-variable)
pySim/runtime.py:528:28: W0612: Unused variable 'remainder' (unused-variable)

Change-Id: I2e164dbaa2070116bed3bac63b0fa5b8aa5b1331
The file was modifiedpySim/runtime.py
Commit 09f9663005b9656e5b72af13b9f0c8ea320767e3 by laforge
pylint: pySim/euicc.py

pySim/euicc.py:27:0: W0622: Redefining built-in 'BlockingIOError' (redefined-builtin)
pySim/euicc.py:27:0: W0401: Wildcard import construct (wildcard-import)
pySim/euicc.py:37:7: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/euicc.py:47:9: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/euicc.py:337:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/euicc.py:325:63: W0613: Unused argument 'exp_sw' (unused-argument)
pySim/euicc.py:335:15: W0612: Unused variable 'sw' (unused-variable)
pySim/euicc.py:361:13: W0612: Unused variable 'data' (unused-variable)
pySim/euicc.py:361:19: W0612: Unused variable 'sw' (unused-variable)
pySim/euicc.py:363:52: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:380:41: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:386:37: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:392:37: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:398:39: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:415:39: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:478:29: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:480:13: W0612: Unused variable 'data' (unused-variable)
pySim/euicc.py:480:19: W0612: Unused variable 'sw' (unused-variable)
pySim/euicc.py:500:31: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:506:48: W0613: Unused argument 'opts' (unused-argument)
pySim/euicc.py:26:0: C0411: third party import "from construct import Optional as COptional" should be placed before "from pySim.tlv import *" (wrong-import-order)
pySim/euicc.py:27:0: C0411: third party import "from construct import *" should be placed before "from pySim.tlv import *" (wrong-import-order)
pySim/euicc.py:28:0: C0411: standard import "import argparse" should be placed before "from construct import Optional as COptional" (wrong-import-order)
pySim/euicc.py:29:0: C0411: third party import "from cmd2 import cmd2, CommandSet, with_default_category" should be placed before "from pySim.tlv import *" (wrong-import-order)
pySim/euicc.py:30:0: C0412: Imports from package pySim are not grouped (ungrouped-imports)
pySim/euicc.py:31:0: W0611: Unused CardADF imported from pySim.filesystem (unused-import)
pySim/euicc.py:31:0: W0611: Unused CardApplication imported from pySim.filesystem (unused-import)

Change-Id: I6c33e2361a042a16f27e66cb883c392333b8383d
The file was modifiedpySim/euicc.py
Commit 8829f8e690180289b617b5e27f838600c1f054ee by laforge
pylint: commands.py

pySim/commands.py:443:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/commands.py:446:0: C0325: Unnecessary parens after 'elif' keyword (superfluous-parens)
pySim/commands.py:669:0: C0325: Unnecessary parens after 'elif' keyword (superfluous-parens)
pySim/commands.py:27:0: W0622: Redefining built-in 'BlockingIOError' (redefined-builtin)
pySim/commands.py:27:0: W0401: Wildcard import construct (wildcard-import)
pySim/commands.py:30:0: W0404: Reimport 'Hexstr' (imported line 29) (reimported)
pySim/commands.py:42:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:48:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:98:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:114:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:131:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:223:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:234:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/commands.py:252:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/commands.py:271:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/commands.py:274:18: W0612: Unused variable 'sw' (unused-variable)
pySim/commands.py:326:16: W0707: Consider explicitly re-raising using 'raise ValueError('%s, failed to read (offset %d)' % (str_sanitize(str(e)), offset)) from e' (raise-missing-from)
pySim/commands.py:386:16: W0707: Consider explicitly re-raising using 'raise ValueError('%s, failed to write chunk (chunk_offset %d, chunk_len %d)' % (str_sanitize(str(e)), chunk_offset, chunk_len)) from e' (raise-missing-from)
pySim/commands.py:443:12: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
pySim/commands.py:521:14: R1714: Consider merging these comparisons with 'in' by using 'sw in ('62f1', '62f2')'. Use a set instead if elements are hashable. (consider-using-in)
pySim/commands.py:532:11: R1701: Consider merging these isinstance calls to isinstance(data, (bytearray, bytes)) (consider-merging-isinstance)
pySim/commands.py:666:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
pySim/commands.py:762:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/commands.py:776:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)

Change-Id: Idfcd6f799d5de9ecacd2c3d1e0d1f7d932f2b8db
The file was modifiedpySim/commands.py
Commit f2322774c790ffbe6e7fda3c700fe355ac0e1ec3 by laforge
pylint: filesystem.py

pySim/filesystem.py:823:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/filesystem.py:849:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/filesystem.py:43:0: W0401: Wildcard import pySim.exceptions (wildcard-import)
pySim/filesystem.py:74:45: C0121: Comparison 'fid == None' should be 'fid is None' (singleton-comparison)
pySim/filesystem.py:94:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/filesystem.py:100:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/filesystem.py:149:8: W0105: String statement has no effect (pointless-string-statement)
pySim/filesystem.py:170:11: C0121: Comparison 'self.parent == None' should be 'self.parent is None' (singleton-comparison)
pySim/filesystem.py:283:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:309:8: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/filesystem.py:314:15: C0117: Consider changing "not 'fid' in kwargs" to "'fid' not in kwargs" (unnecessary-negation)
pySim/filesystem.py:317:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal)
pySim/filesystem.py:418:11: C0121: Comparison 'name == None' should be 'name is None' (singleton-comparison)
pySim/filesystem.py:427:11: C0121: Comparison 'sfid == None' should be 'sfid is None' (singleton-comparison)
pySim/filesystem.py:452:28: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal)
pySim/filesystem.py:508:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/filesystem.py:531:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/filesystem.py:576:8: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/filesystem.py:599:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:609:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:620:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:633:28: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:642:41: W0613: Unused argument 'opts' (unused-argument)
pySim/filesystem.py:644:24: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:696:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:723:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:749:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:777:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:797:8: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/filesystem.py:822:23: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:838:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:844:34: W0613: Unused argument 'opts' (unused-argument)
pySim/filesystem.py:848:23: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:866:23: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:878:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:893:28: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:910:24: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:967:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:995:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1023:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1051:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1114:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1141:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1167:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1194:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
pySim/filesystem.py:1226:8: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/filesystem.py:1236:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:1239:35: W0613: Unused argument 'opts' (unused-argument)
pySim/filesystem.py:1252:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:1263:19: W0612: Unused variable 'sw' (unused-variable)
pySim/filesystem.py:1315:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal)
pySim/filesystem.py:35:0: C0411: standard import "import argparse" should be placed before "import cmd2" (wrong-import-order)
pySim/filesystem.py:37:0: C0411: standard import "from typing import cast, Optional, Iterable, List, Dict, Tuple, Union" should be placed before "import cmd2" (wrong-import-order)
pySim/filesystem.py:27:0: W0611: Unused import code (unused-import)
pySim/filesystem.py:34:0: W0611: Unused with_argparser imported from cmd2 (unused-import)
pySim/filesystem.py:41:0: W0611: Unused i2h imported from pySim.utils (unused-import)
pySim/filesystem.py:41:0: W0611: Unused Hexstr imported from pySim.utils (unused-import)
pySim/filesystem.py:44:0: W0611: Unused js_path_find imported from pySim.jsonpath (unused-import)
pySim/filesystem.py:43:0: W0614: Unused import(s) NoCardError, ProtocolError, ReaderError and SwMatchError from wildcard import of pySim.exceptions (unused-wildcard-import)

Change-Id: I94e1f5791e9fc34a60d0254978a35fd6ab2ff8d7
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/apdu/ts_102_221.py
Commit 472165f20fd510bec895ca6db021a337420d34de by laforge
pylint: ts_102_222.py

pySim/ts_102_222.py:195:0: W0311: Bad indentation. Found 15 spaces, expected 12 (bad-indentation)
pySim/ts_102_222.py:201:0: W0311: Bad indentation. Found 15 spaces, expected 12 (bad-indentation)
pySim/ts_102_222.py:26:0: W0401: Wildcard import pySim.exceptions (wildcard-import)
pySim/ts_102_222.py:35:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/ts_102_222.py:52:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:52:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:73:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:73:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:89:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:89:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:107:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:107:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:152:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:152:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:203:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:203:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:220:9: W0612: Unused variable 'data' (unused-variable)
pySim/ts_102_222.py:220:15: W0612: Unused variable 'sw' (unused-variable)
pySim/ts_102_222.py:24:0: C0411: standard import "import argparse" should be placed before "import cmd2" (wrong-import-order)
pySim/ts_102_222.py:23:0: W0611: Unused with_argparser imported from cmd2 (unused-import)
pySim/ts_102_222.py:27:0: W0611: Unused h2b imported from pySim.utils (unused-import)
pySim/ts_102_222.py:27:0: W0611: Unused swap_nibbles imported from pySim.utils (unused-import)
pySim/ts_102_222.py:27:0: W0611: Unused JsonEncoder imported from pySim.utils (unused-import)
pySim/ts_102_222.py:26:0: W0614: Unused import(s) NoCardError, ProtocolError, ReaderError and SwMatchError from wildcard import of pySim.exceptions (unused-wildcard-import)

Change-Id: If251c6cb10e637a13adaaf3ae848501908b9c345
The file was modifiedpySim/ts_102_222.py
Commit f2b20bf6ca4964c6abf4b5622a045d315f23cdcb by laforge
pylint: utils.py

pySim/utils.py:903:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
pySim/utils.py:153:16: R1719: The if expression can be replaced with 'bool(test)' (simplifiable-if-expression)
pySim/utils.py:158:16: R1719: The if expression can be replaced with 'bool(test)' (simplifiable-if-expression)
pySim/utils.py:166:16: R1719: The if expression can be replaced with 'bool(test)' (simplifiable-if-expression)
pySim/utils.py:222:19: R1719: The if expression can be replaced with 'not test' (simplifiable-if-expression)
pySim/utils.py:237:18: R1719: The if expression can be replaced with 'bool(test)' (simplifiable-if-expression)
pySim/utils.py:246:19: R1719: The if expression can be replaced with 'not test' (simplifiable-if-expression)
pySim/utils.py:279:11: W0612: Unused variable 'remainder' (unused-variable)
pySim/utils.py:541:7: R1714: Consider merging these comparisons with 'in' by using 'eutran_bits in (16384, 28672)'. Use a set instead if elements are hashable. (consider-using-in)
pySim/utils.py:550:7: R1714: Consider merging these comparisons with 'in' by using 'gsm_bits in (128, 140)'. Use a set instead if elements are hashable. (consider-using-in)
pySim/utils.py:614:7: C0121: Comparison 'imsi == None' should be 'imsi is None' (singleton-comparison)
pySim/utils.py:627:7: C0121: Comparison 'imsi == None' should be 'imsi is None' (singleton-comparison)
pySim/utils.py:733:7: R1714: Consider merging these comparisons with 'in' by using 'msisdn in ('', '+')'. Use a set instead if elements are hashable. (consider-using-in)
pySim/utils.py:774:8: W0612: Unused variable 'try_encode' (unused-variable)
pySim/utils.py:803:16: W0707: Consider explicitly re-raising using 'except ValueError as exc' and 'raise ValueError('PIN-ADM needs to be hex encoded using this option') from exc' (raise-missing-from)
pySim/utils.py:801:16: W0612: Unused variable 'try_encode' (unused-variable)
pySim/utils.py:821:7: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)
pySim/utils.py:836:4: W0612: Unused variable 'e' (unused-variable)
pySim/utils.py:892:7: C0121: Comparison 'str_list == None' should be 'str_list is None' (singleton-comparison)
pySim/utils.py:991:11: R1701: Consider merging these isinstance calls to isinstance(o, (BytesIO, bytearray, bytes)) (consider-merging-isinstance)

Change-Id: I190ae75964ef6e0ed43fae994693a8bccd21c7f7
The file was modifiedpySim/utils.py
Commit 6db681924cffc9f36c9fcdf1567a8cadcae5390c by laforge
pylint: tlv.py

pySim/tlv.py:29:0: W0401: Wildcard import pySim.exceptions (wildcard-import)
pySim/tlv.py:43:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument)
pySim/tlv.py:66:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument)
pySim/tlv.py:89:11: C0121: Comparison 'self.decoded == None' should be 'self.decoded is None' (singleton-comparison)
pySim/tlv.py:170:8: R1703: The if statement can be replaced with 'return bool(test)' (simplifiable-if-statement)
pySim/tlv.py:202:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/tlv.py:257:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/tlv.py:308:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/tlv.py:383:15: C0121: Comparison 'tag == None' should be 'tag is None' (singleton-comparison)
pySim/tlv.py:382:17: W0612: Unused variable 'r' (unused-variable)
pySim/tlv.py:389:16: W0612: Unused variable 'dec' (unused-variable)
pySim/tlv.py:461:22: R1718: Consider using a set comprehension (consider-using-set-comprehension)
pySim/tlv.py:473:0: C0206: Consider iterating with .items() (consider-using-dict-items)
pySim/tlv.py:473:58: C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
pySim/tlv.py:20:0: W0611: Unused Optional imported from typing (unused-import)
pySim/tlv.py:20:0: W0611: Unused Dict imported from typing (unused-import)
pySim/tlv.py:20:0: W0611: Unused Any imported from typing (unused-import)
pySim/tlv.py:21:0: W0611: Unused bidict imported from bidict (unused-import)
pySim/tlv.py:28:0: W0611: Unused LV imported from pySim.construct (unused-import)
pySim/tlv.py:28:0: W0611: Unused HexAdapter imported from pySim.construct (unused-import)
pySim/tlv.py:28:0: W0611: Unused BcdAdapter imported from pySim.construct (unused-import)
pySim/tlv.py:28:0: W0611: Unused BitsRFU imported from pySim.construct (unused-import)
pySim/tlv.py:28:0: W0611: Unused GsmStringAdapter imported from pySim.construct (unused-import)
pySim/tlv.py:29:0: W0614: Unused import(s) NoCardError, ProtocolError, ReaderError and SwMatchError from wildcard import of pySim.exceptions (unused-wildcard-import)

Change-Id: Ic22d00d3ae73ad81167276d9482b7b86a04476ba
The file was modifiedpySim/tlv.py
Commit 55be7d48ee8663d382b3565d51f94387c0ccab24 by laforge
pylint: construct.py

pySim/construct.py:47:0: W0311: Bad indentation. Found 16 spaces, expected 12 (bad-indentation)
pySim/construct.py:59:0: W0311: Bad indentation. Found 16 spaces, expected 12 (bad-indentation)
pySim/construct.py:82:0: W0311: Bad indentation. Found 16 spaces, expected 12 (bad-indentation)
pySim/construct.py:1:0: C0114: Missing module docstring (missing-module-docstring)
pySim/construct.py:14:0: W0105: String statement has no effect (pointless-string-statement)
pySim/construct.py:178:29: W0613: Unused argument 'instr' (unused-argument)
pySim/construct.py:199:15: C0121: Comparison 'codepoint_prefix == None' should be 'codepoint_prefix is None' (singleton-comparison)
pySim/construct.py:269:15: C0121: Comparison 'v == False' should be 'v is False' if checking for the singleton value False, or 'not v' if testing for falsiness (singleton-comparison)
pySim/construct.py:271:17: C0121: Comparison 'v == True' should be 'v is True' if checking for the singleton value True, or 'v' if testing for truthiness (singleton-comparison)
pySim/construct.py:385:15: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/construct.py:392:15: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/construct.py:408:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
pySim/construct.py:421:7: R1701: Consider merging these isinstance calls to isinstance(c, (Container, dict)) (consider-merging-isinstance)
pySim/construct.py:444:11: R1729: Use a generator instead 'all(v == 255 for v in raw_bin_data)' (use-a-generator)
pySim/construct.py:434:81: W0613: Unused argument 'exclude_prefix' (unused-argument)
pySim/construct.py:544:12: W0707: Consider explicitly re-raising using 'raise IntegerError(str(e), path=path) from e' (raise-missing-from)
pySim/construct.py:561:8: R1731: Consider using 'nbytes = max(nbytes, minlen)' instead of unnecessary if block (consider-using-max-builtin)
pySim/construct.py:573:12: W0707: Consider explicitly re-raising using 'raise IntegerError(str(e), path=path) from e' (raise-missing-from)
pySim/construct.py:3:0: C0411: standard import "import typing" should be placed before "from construct.lib.containers import Container, ListContainer" (wrong-import-order)
pySim/construct.py:10:0: C0411: third party import "import gsm0338" should be placed before "from pySim.utils import b2h, h2b, swap_nibbles" (wrong-import-order)
pySim/construct.py:11:0: C0411: standard import "import codecs" should be placed before "from construct.lib.containers import Container, ListContainer" (wrong-import-order)
pySim/construct.py:12:0: C0411: standard import "import ipaddress" should be placed before "from construct.lib.containers import Container, ListContainer" (wrong-import-order)
pySim/construct.py:7:0: W0611: Unused BitwisableString imported from construct.core (unused-import)

Change-Id: Ic8a06d65a7bcff9ef399fe4e7e5d82f271c946bb
The file was modifiedpySim/construct.py
Commit 908634396ff6a6d2adf907576523c449d9a8dbab by laforge
pylint: global_platform/__init__.py

pySim/global_platform/__init__.py:468:4: W0221: Number of parameters was 2 in 'CardFile.decode_select_response' and is now 1 in overriding 'ADF_SD.decode_select_response' method (arguments-differ)
pySim/global_platform/__init__.py:473:8: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
pySim/global_platform/__init__.py:491:19: W0612: Unused variable 'sw' (unused-variable)
pySim/global_platform/__init__.py:528:22: W0612: Unused variable 'sw' (unused-variable)
pySim/global_platform/__init__.py:559:12: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
pySim/global_platform/__init__.py:587:18: W0612: Unused variable 'sw' (unused-variable)
pySim/global_platform/__init__.py:617:20: W0612: Unused variable 'dec' (unused-variable)
pySim/global_platform/__init__.py:645:12: W0612: Unused variable 'data' (unused-variable)
pySim/global_platform/__init__.py:645:18: W0612: Unused variable 'sw' (unused-variable)
pySim/global_platform/__init__.py:746:15: C0121: Comparison 'opts.key_id == None' should be 'opts.key_id is None' (singleton-comparison)
pySim/global_platform/__init__.py:746:39: C0121: Comparison 'opts.key_ver == None' should be 'opts.key_ver is None' (singleton-comparison)
pySim/global_platform/__init__.py:750:15: C0121: Comparison 'opts.key_id != None' should be 'opts.key_id is not None' (singleton-comparison)
pySim/global_platform/__init__.py:752:15: C0121: Comparison 'opts.key_ver != None' should be 'opts.key_ver is not None' (singleton-comparison)
pySim/global_platform/__init__.py:787:16: W0612: Unused variable 'rsp_hex' (unused-variable)
pySim/global_platform/__init__.py:787:25: W0612: Unused variable 'sw' (unused-variable)
pySim/global_platform/__init__.py:836:30: W0612: Unused variable 'sw' (unused-variable)
pySim/global_platform/__init__.py:839:12: W0612: Unused variable 'ext_auth_resp' (unused-variable)
pySim/global_platform/__init__.py:846:33: W0613: Unused argument 'opts' (unused-argument)
pySim/global_platform/__init__.py:878:15: R1716: Simplify chained comparison between the operands (chained-comparison)
pySim/global_platform/__init__.py:886:29: W0613: Unused argument 'kvn' (unused-argument)
pySim/global_platform/__init__.py:893:0: C0413: Import "from Cryptodome.Cipher import DES, DES3, AES" should be placed at the top of the module (wrong-import-position)
pySim/global_platform/__init__.py:23:0: C0411: standard import "from typing import Optional, List, Dict, Tuple" should be placed before "from construct import Optional as COptional" (wrong-import-order)
pySim/global_platform/__init__.py:24:0: C0411: standard import "from copy import deepcopy" should be placed before "from construct import Optional as COptional" (wrong-import-order)
pySim/global_platform/__init__.py:893:0: C0411: third party import "from Cryptodome.Cipher import DES, DES3, AES" should be placed before "from pySim.global_platform.scp import SCP02, SCP03" (wrong-import-order)
pySim/global_platform/__init__.py:893:0: C0412: Imports from package Cryptodome are not grouped (ungrouped-imports)

Change-Id: Iea6afb5e72e035637e761bb25535f48fd4bc99f4
The file was modifiedpySim/global_platform/__init__.py
Commit 9d1487af6dbf8b8ea2d1bb83045fd51bc1ec48fa by laforge
global_platform: Fix INSTALL [for personalization]

The APDU hex string needs to use %02x instead of %02u...

Change-Id: Ic3b30ba623ee04f5190c77afd226b52165b3183f
The file was modifiedpySim/global_platform/__init__.py
Commit d6ecf272f5895b7d9cb8b1ef1d2be229f035f63f by laforge
pySim-shell: Fix regression in 'apdu' command on cards without profile

Cards where no profile was detected don't have a logical channel, and
hence must use the raw APDU at all times.

Change-Id: I08e5d190bdb4e62ee808bfd77584cb3e0b85a8ae
Fixes: Change-Id Id0c364f772c31e11e8dfa21624d8685d253220d0
The file was modifiedpySim-shell.py
Commit e1c0b626d81a17b6b1cc8d7e08e97ebe2d70c8a2 by laforge
global_platform: Add --suppress-key-check option to put_key command

In some cases we may not want to auto-generate the Key Check Values.

Change-Id: I244b717b3e3aae6eb3ad512f9e23ff0b65958bb7
The file was modifiedpySim/global_platform/__init__.py
Commit 95873a964e13bb122e54838d9bd180bb31b4d9c8 by laforge
Introduce code for ES2+ API client functionality

Change-Id: Id652bb4c2df8893a824b8bb44beeafdfbb91de3f
The file was addedcontrib/es2p_client.py
The file was addedpySim/esim/es2p.py
The file was modifiedcontrib/jenkins.sh
The file was modifiedpySim/esim/__init__.py
Commit eac459fe24223fc8b456ee07c56a639efb0ae598 by laforge
ts_31_102: Add support for "USIM supporting non-IMSI SUPI Type"

This type of USIM was introduced in Release 16.4. It is basically
a copy of ADF.USIM without the EF.IMSI file and a dedicated AID.

Change-Id: Ifcde27873a398273a89889bb38537f79859383e9
The file was modifiedpySim/ts_31_102.py
Commit 1432af51500de2b06cfc6861416e8e29128c05fd by laforge
Add terminal_capability command to send TERMINAL CAPABILITY

TS 102 221 specifies a TERMINAL CAPABILITY command using which the
terminal (Software + hardware talking to the card) can expose their
capabilities.  This is also used in the eUICC universe to let the eUICC
know which features are supported.

Change-Id: Iaeb8b4c34524edbb93217bf401e466399626e9b0
The file was modifieddocs/shell.rst
The file was modifiedpySim/ts_102_221.py
Commit 979c837286d3e5fa41322d2f97c4a31494cb5da5 by laforge
Dynamically determine maximum CMD data length depending on SCP

If we're using a Secure Channel Protocol, this will add overhead
in terms of the C-MAC appended to the C-APDU.  This means in turn that
the useable length of the data field shrinks by a certain number of
bytes.

Let's make sure the SCP instances expose an 'overhead' property
of how much overhead they add - and that other commands use this to
determine the maximum command data field length.

Change-Id: I0a081a23efe20c77557600e62b52ba90a401058d
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/commands.py
The file was modifiedpySim/global_platform/scp.py
Commit efdf423a7f758987de249412e8e67ac94f9d09aa by laforge
utils: Add function to verify Luhn check digits and to sanitize ICCIDs

Change-Id: I7812420cf97984dd834fca6a38c5e5ae113243cb
The file was modifiedpySim/utils.py
The file was modifiedtests/test_utils.py
Commit 54b4f0ccbd65832d4ff4ec2439642c6c0f08089c by laforge
asn1/saip: Fix typo in original ASN.1: Compontents -> Components

Change-Id: I6bec5625579873a9ec267d896584608c9d5e3a2f
The file was modifiedpySim/esim/asn1/saip/PE_Definitions-3.3.1.asn
Commit d16a20ccc3e67ffab1142d4f0541989ccc36a7ec by laforge
saip: profile processing; merging with templates

Introduce code that makes use of the information from
pySim.esim.saip.templates to build a complete representation of a file
by merging the template with the ProfileElement decribing the file.

This happens within the class pySim.esim.saip.File, whose instances are
created from ProfileElement + Template.

Change-Id: Ib1674920e488ade9597cb039e4e2047dcbc7864e
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedpySim/esim/saip/validation.py
Commit 5ff0bafcdab012ceaaa5f9372d3014d50145db07 by laforge
pylint: esim/saip/__init__.py

pySim/esim/saip/__init__.py:28:0: R0402: Use 'from pySim.esim.saip import templates' instead (consider-using-from-import)
pySim/esim/saip/__init__.py:166:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
pySim/esim/saip/__init__.py:206:4: W0612: Unused variable 'tagdict' (unused-variable)
pySim/esim/saip/__init__.py:273:23: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)

Change-Id: I12ef46c847d197fb0c01e624818aeac14eb99e31
The file was modifiedpySim/esim/saip/__init__.py
Commit 7d88b076ad69932e560a077124f20e3e475ad89e by laforge
pylint: esim/saip/validation.py

pySim/esim/saip/validation.py:95:42: C0117: Consider changing "not not ('usim' in m_svcs or 'isim' in m_svcs)" to "'usim' in m_svcs or 'isim' in m_svcs" (unnecessary-negation)
pySim/esim/saip/validation.py:129:0: C0305: Trailing newlines (trailing-newlines)

Change-Id: Idcc9871d6a7068e8aedbd8cd81f4156918af5e50
The file was modifiedpySim/esim/saip/validation.py
Commit 922b8a279c1e3bc3fe5137704585f6eb27ed3c7c by laforge
saip: improve docstrings

Change-Id: I0ca82a434e0bde3dc1b304dfc179d568588631c6
The file was modifiedpySim/esim/saip/personalization.py
The file was modifiedpySim/esim/saip/__init__.py
Commit 8449b14d08b3a607a702c0906e875ed5eb6e0188 by laforge
osmo-smdpp: Get rid of hard-coded ICCID

Read the ICCID from the header of the UPP when building the
ProfileMetdata.  This allows the download of profiles with arbitrary ICCID.

Change-Id: I1b9e17f757f9935436828e6dc1ab75ff17d1d1a4
The file was modifiedosmo-smdpp.py
Commit aa76546d165b54bd1113d6e38e722543be1069b4 by laforge
osmo-smdpp: Add TS.48 profiles modified for unique ICCIDs

The original TS.48 profiles have shared/overlapping ICCIDs meaning you
can always install one of them on a given eUICC.  Let's add a set of
modified TS.48 profiles so  you can install any number of them in
parallel on a single eUICC, switching between them via your LPA.

Change-Id: Id5019b290db1ee90ae1c72b312f08bf3184908ea
The file was addedsmdpp-data/upp/TS48V3-SAIP2-1-BERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V2-SAIP2-1-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V2-SAIP2-1-BERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V4-SAIP2-1B-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V2-SAIP2-3-BERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V4-SAIP2-3-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V4-SAIP2-1A-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V3-SAIP2-3-BERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V5-SAIP2-1B-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V5-SAIP2-3-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V4-SAIP2-3-BERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V5-SAIP2-1A-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V3-SAIP2-1-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V5-SAIP2-3-BERTLV-SUCI-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V1-A-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V2-SAIP2-3-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V3-SAIP2-3-NOBERTLV-UNIQUE.der
The file was addedsmdpp-data/upp/TS48V1-B-UNIQUE.der
Commit 318faef583c8afa9e7e1eb2d3b71337fa69f52b2 by laforge
saip.personalization: include encode/decode of value; add validation method

Change-Id: Ia9fa39c25817448afb191061acd4be894300eeef
The file was modifiedpySim/esim/saip/personalization.py
The file was modifiedtests/test_esim_saip.py
Commit 19fa98e7d037d9d953262aeae3fe56b45ecc4df2 by laforge
saip.personalization: Add support for SCP80/81/02/03 keys

Those keys are normally per-card unique, and hence the personalization
must be able to modify them in the profile.

Change-Id: Ibe4806366f1cce8edb09d52613b1dd56250fa5ae
The file was modifiedpySim/esim/saip/personalization.py
Commit 2de552e7123b16a54129ba8cfde5a1a25a09df6b by laforge
saip.personalization: differentiate input_value from value

When personalizing e.g. the ICCID, the input_value is the raw
incrementing counter.  From that, we calculate the Luhn check digit,
and that "output" value is what we'll put in to the EF.ICCID specific
encoder.

However, we also store that output value in the instance in order
to generate the output CSV file containig the card-specific
personalization data.

Change-Id: Idfcd26c8ca9d73a9c2955f7c97e711dd59a27c4e
The file was modifiedpySim/esim/saip/personalization.py
Commit 6d63712b51ba3c77361f9dd11f6fe672b0ddedca by laforge
saip.personalization: automatically compute class 'name' attribute

We can use the metaclass to set a proper non-camel-case name attribute.

Change-Id: If02df436c8f5ce01d21e9ee077ad3736e669d103
The file was modifiedpySim/esim/saip/personalization.py
Commit b18c7d9be09882aee9b79f5b7d4f9bb51af97a09 by laforge
saip.personalization: Fix encoding of ICCID in ProfileHeader

To make things exciting, they decided that the ICCID in the profile
header is encoded different from the ICCID contained in EF.ICCID...

Change-Id: I5eacdcdc6bd0ada431eb047bfae930d79d6e3af8
The file was modifiedpySim/esim/saip/personalization.py
Commit decb4680927a2566af67b848382437a6549f850a by Vadim Yanitskiy
tests: assertEquals() is deprecated, use assertEqual()

This fixes deprecation warnings printed by Python 3.11.7.

Change-Id: I1de93b0fee9e8439f7da8a3b9fd2a6974973fb4f
The file was modifiedtests/test_euicc.py
Commit 2c219cd706e0ad6ace7eaf17543b109d03215697 by laforge
docs/shell: Give users some hints on what to do if encoding/decoding fails

Change-Id: I557991da748126f3585b88b27706b29e0264635b
Related: OS#6385
The file was modifieddocs/shell.rst
Commit ee4db7010b8da616ef0a0ef023cf9261445fb569 by laforge
sysmocom_sja2: Add test vectors for EF_USIM_AUTH_KEY

Change-Id: I8be62ba52fbbf6d470f771906a5d3734cca5bac8
The file was modifiedpySim/sysmocom_sja2.py
Commit 7b524fa079f8b166eb905befe0f84f181106c109 by pmaier@sysmocom.de
osmo-smdpp: fix generation of transactionId

The hex string of the generated transactionId contains lowercase hex
digits. However SGP.22 explicitly spcifies to use uppercase hex digits
when using JSON fromatted messages. See section 6.5.2.6 for example.

Related: SYS#6720
Change-Id: I8439aa9d70f6fe798fa88b623bac13debdc19ca1
The file was modifiedosmo-smdpp.py
Commit 3aa0b41f3931f2a96a45ca1e7919df1ef04f512d by laforge
pySim-prog: convert from optparse to argparse

We already use argparse everywhere else, and we have moved reader-driver
argument parsing into the library expecting argparse.

Change-Id: I7407496643247c754d002656688e9fdcbcf644a8
The file was modifiedpySim-prog.py
Commit 24a7f168bd53e97305d3dc2dea7b0d4bb28c20ab by laforge
pcsc: open reader/card in EXCLUSIVE mode by default

There was a support request hinting that other applications
concurrently accessed the SIM and were messing up the card state while
pySim-shell was running.

Let's avoid such situations by opening the card/reader in EXCLUSIVE mode
by default.  If somebody really has a special use case, they can now add
the --pcsc-shared flag to restore the legacy behavior (SHARED mode).

Change-Id: I90d887714b559a4604708d3c6dd23b5e05f40576
The file was modifiedpySim/transport/pcsc.py
Commit 479aeb0b00fdb96a5dc2a92db962c84146f53884 by icecream
add missing modules to setup.py

Change-Id: I330d5e35e5f1b508c6209b6894009b5fdd35d660
The file was modifiedsetup.py
Commit a412c436b4bd399863723056b5607d6af1ae4725 by Vadim Yanitskiy
contrib/jenkins.sh: add 'distcheck' job to check package integrity

The idea of this new job is to catch package integrity problems,
like the missing entries in setup.py/packages[] or missing deps.

Change-Id: Ic72d58494e8fd0cab8d66ce60f7b70593b770872
Related: osmo-ci.git I9d4d9e9de2b16a4b745791f3c9c93507f43bfa6d
The file was modifiedcontrib/jenkins.sh
Commit 0c5dfd9d231f67759aa3cc621217a877843a91b0 by laforge
README.md: Point to simtrace mailing list

SIM card related topics are best kept there and not on openbsc.

Change-Id: I0dedd2ed0ab07c6020f9d30857654c5600c53814
The file was modifiedREADME.md
Commit 60eef0264a17e0acbf7427d7f14242758aa020f5 by laforge
README.md: Link to discourse forum

Change-Id: Ia5ecbd4f2c2a5dfa1ba69ae2b5712da7abc93c4e
The file was modifiedREADME.md
Commit f3432eef4cbc3dfb1b7745d65b9f33b48614ca35 by laforge
README.md: Add link to issue tracker

Change-Id: I33f4e05486d609b2c903c8341dccf1ee01e90577
The file was modifiedREADME.md
Commit 7aeeb4f4755094c4bafc1a23fd76b9fba9edb42f by laforge
Add funding link to github mirror

see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: Ib23e6f406ab9546f59ec9e8c6b3eaf27c3dce410
The file was added.github/FUNDING.yml
Commit b2b29cfed1d0b23d004b3ec122c7c9d1c51f4d49 by laforge
esim.es2p: Permit ApiParamInteger to be an actual integer

Usually, the specifications say that the integer type is actually
transmitted as a JSON string type.  However, it seems some
implementations do return a native JSON integer type.  Let's be
tolerant in that regard.

Change-Id: I5b47f8bba01225d53eff2ca086e53a2133abed7f
The file was modifiedpySim/esim/es2p.py
Commit 1d1ba8e4cc0cb8c1f862dad04b26e5d4786b924d by laforge
esim.esp2: Allow HTTP methods other than POST

While all official/standardized ES2+ API functions use POST, there
are some vendor-specific extensions using different HTTP methods.  Be
flexible enough to allow derived classes to easily specify other methods.

Change-Id: I4b1a0dc7e6662485397c7708933bf16e5ed56e10
The file was modifiedpySim/esim/es2p.py
Commit 57df6f6e6856c5633816a901dda3d17e77fcce18 by laforge
filesystem: Enforce lower-case hex AID

our utils.b2h() returns values in lower-case hex string notation,
so let's make sure the CardADF and CardApplication AID values are also
stored in lower case notation, othewise the matching baesd on AIDs
returned from the card will not work, specifically as we use uppercase
AIDs in pySim.euicc for CardApplicationECASD and CardApplicationISDR.

Rather than change those two instances, let's solve it in a generic way.

We already do the same for the CardFile.fid member.

Change-Id: Ie42392412d9eb817fbc563d9165faab198ffa7a9
The file was modifiedpySim/filesystem.py
Commit 900b04559b28606692ed261d425e0dce1dd40f98 by laforge
euicc: Fix shell command for SGP.31 get_certs

Change-Id: I2e59070992bb522d14a5e4956f0d8e738a785dd8
The file was modifiedpySim/euicc.py
Commit a644fecc01af11534d65704e1cc302f47f18fc36 by laforge
pySim.global_platform: Fix key encryption with DEK

When a SCP is active, the DEK is used to encrypt any key material
that's installed using PUT KEY.  The code prior to this patch fails
to handle this case as it calls the encrypt_key() method on the wrong
object.

Change-Id: I6e10fb9c7881ba74ad2986c36bba95b336470838
The file was modifiedpySim/global_platform/__init__.py
Commit 73a5c74114ffdda7295f2d8b2f329a535e062cb3 by laforge
pySim-trace: Support decoding of eUICC traces

Let's register the ISD-R and ECASD applications so we avoid the warnings
printed when processing an eUICC protocol trace:

WARNING  pySim.apdu.ts_102_221: SELECT UNKNOWN AID a0000005591010ffffffff8900000100

Change-Id: I362a1a7f12d979ff0b7971d5300db9ed56bb1ee5
The file was modifiedpySim-trace.py
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
Commit 45b7d0126b82c2bdefeb80ebb2b6b9b41a84789b by laforge
commands.py: Resolve possible variable use before assignment

pySim/commands.py:223:18: E0606: Possibly using variable 'skip' before assignment (possibly-used-before-assignment)

Let's raise an exception in the erroneous case.

Change-Id: Id1a892c3446e472699e77f076c2414277e92c98d
The file was modifiedpySim/commands.py
Commit bb2cba83c5a336d1b8e03b3cb31b5c6b81bfb7b8 by laforge
commands.py: Resolve possible variable use before assignment

pySim/commands.py:608:39: E0606: Possibly using variable 'p2' before assignment (possibly-used-before-assignment)

Let's raise an exception in the erroneous case.

Change-Id: I23adf2e89aa8a13246cc20ef022c84f0113eb2cd
The file was modifiedpySim/commands.py
Commit c3d04ab19306c93c9d6af60d185214799700478a by laforge
euicc.py: Resolve possible variable use before assignment

pySim/euicc.py:436:31: E0606: Possibly using variable 'p_id' before assignment (possibly-used-before-assignment)
pySim/euicc.py:455:31: E0606: Possibly using variable 'p_id' before assignment (possibly-used-before-assignment)
pySim/euicc.py:473:31: E0606: Possibly using variable 'p_id' before assignment (possibly-used-before-assignment)

Let's raise an exception in the erroneous case.

Change-Id: Ifdf4651e503bae6ea3e91c89c2121b416a12fb1a
The file was modifiedpySim/euicc.py
Commit 81bc26cc31769678d9870d0f3116aa8af9b9b292 by laforge
osmo-smdpp.py: Resolve possible variable use before assignment

osmo-smdpp.py:374:72: E0601: Using variable 'iccid_str' before assignment (used-before-assignment)

Let's raise an exception in the erroneous case.

Change-Id: I01b308226e12f91699b1b5c6bb06f853be47e185
The file was modifiedosmo-smdpp.py
Commit a3f22ea259ac24ab57fa6608e3741a6f10616efd by laforge
pySim-prog.py: Resolve possible variable use before assignment

pySim-prog.py:741:7: E0606: Possibly using variable 'cp' before assignment (possibly-used-before-assignment)

Change-Id: I6ab307db378d2ca76dfeae53dc3befa7c103974d
The file was modifiedpySim-prog.py
Commit 568d8cf5dbb0ee968b39db425a859167eb79979f by laforge
pySim-trace.py: Resolve possible variable use before assignment

pySim-trace.py:198:27: E0606: Possibly using variable 's' before assignment (possibly-used-before-assignment)

Change-Id: I28c137a20143b2cd6ea9a0d5461ab61fcd6fe935
The file was modifiedpySim-trace.py
Commit 91ec099680112ae4457c74f6b9c879435330f7d8 by laforge
euicc: clarify which eUICCs are supported

We currently do not support M2M eUICC

Change-Id: I3deb9f181075411484158471012ed449c83028fa
The file was modifiedpySim/euicc.py
Commit daeba3c1fb4e3e73293dbb546af686b8101bbc2a by laforge
sysmocom_sjs2: Make sure 'Const' is imported

  File "/crypt/space/home/laforge/projects/git/pysim/pySim/sysmocom_sja2.py", line 180, in __init__
    self._construct = Struct(Const(b'\x82'), 'time_unit'/self.TimeUnit, 'value'/Int8ub,
                             ^^^^^
NameError: name 'Const' is not defined

Change-Id: If34a48e349680ef84e68a4a1a19dde536ecda0e6
The file was modifiedpySim/sysmocom_sja2.py
Commit 172c9f7ca6a2c8aadf1f1ae06055c08ae7eea6e8 by laforge
pySim/cat: Fix contruct for Address class/IE

Something like "this._.total_len-1" only works during decode. Let's
use GreedyBytes instead, working for encode and decode.

Change-Id: Idf8326298cab7ebc68b09c7e829bfc2061222f51
The file was modifiedpySim/cat.py
Commit 56264669a7548ca4c0cc816cea67472b1a7ff1dc by laforge
pcsc: don't assume opts.pcsc_shared is present

Fixes running contrib/sim-rest-server.py:
  builtins.AttributeError: 'Namespace' object has no attribute 'pcsc_shared'

Change-Id: I864f65849c5d43cf7c73e60f1935afdf4273f696
The file was modifiedpySim/transport/pcsc.py
Commit 6add18ea087a0849307c0d0a3d41f8df5a8a82ac by laforge
contrib/sim-rest-client: don't crash without args

When running without an argument, let argparse print a nice usage error:

  $ ./sim-rest-client.py
  usage: sim-rest-client.py [-h] [-H HOST] [-p PORT] [-v] [-n SLOT_NR] {auth,info} ...
  sim-rest-client.py: error: the following arguments are required: {auth,info}

Instead of:

  $ ./sim-rest-client.py
  Traceback (most recent call last):
    File "/usr/share/pysim/contrib/./sim-rest-client.py", line 185, in <module>
      main(sys.argv)
    File "/usr/share/pysim/contrib/./sim-rest-client.py", line 181, in main
      args.func(args)
      ^^^^^^^^^
  AttributeError: 'Namespace' object has no attribute 'func'

Change-Id: I92998d9b94dcfb9dcfc3da161fe5d8f45f242b78
The file was modifiedcontrib/sim-rest-client.py
Commit 8844603941c1a7d6dfe2b2226e300c0f91528d73 by laforge
pySim/global_platform: Fix install_for_personalization command

A mix-up betewen underscore and dash resulted in:

Change-Id: I49d12b7c7ae2a343940e87d5069c0ae44a9bc50c
AttributeError: 'Namespace' object has no attribute 'application_aid'
The file was modifiedpySim/global_platform/__init__.py
Commit a823ce89f6c79f4212e7cf52655e88cf38570eee by laforge
pySim/commands: STATUS: Use indeterminate length Le/P3 == '00'

Let's have the card tell us what the length is by indicating '00'
instead of stating 'FF'.  This is better aligned with general practice
and won't break assumptions in other parts of the code like SCP
transport.

Change-Id: Ied63c6e1970e3dfc675da5e5f94579fbb06fea51
The file was modifiedpySim/commands.py
Commit 3ba10b61e10435e920c4ffa008c4f924395a0fc3 by laforge
pysim/euicc: Remove duplicated code

The get_eid command is actually sending the command apdu twice, as
it contains both an older implementation (result unused) and the newer
one.

Change-Id: Ie82bb09f4fc30bc879029b83147dad5614792b48
The file was modifiedpySim/euicc.py
Commit f47433863e6218d4c55663a34ce0130e52ecbee0 by laforge
runtime: Introduce an 'identity' dict for things like ATR, ICCID, EID

This patch introduces the dict, as well as its first use for ATR storage

Change-Id: Ief5ceaf5afe82800e33da233573293527befd2f4
The file was modifiedpySim/runtime.py
The file was modifiedpySim-shell.py
Commit 7f6102365ceac7a5bfb5315e5d3b016b71294bcc by laforge
pySim-shell: Migrate PySimApp.iccid to RuntimeState.identity['ICCID']

In the previous patch, we've introduced a new 'identities' dict as part
of the runtime state.  Let's migrate our ICCID storage into it for
consistency.

Change-Id: Ibdcf9a7c4e7e445201640bce33b768bcc4460db1
The file was modifiedpySim-shell.py
Commit e4450afb4ebf37fd2c2a2a089236f87a9fd92b45 by laforge
pySim.app: Attempt to retrieve the EID of a SGP.22 / SGP.32 eUICC

... and populate the RuntimeState.identity['EID'] wit it, so other
[future] parts of the system can use it.

Let's also print the EID (if available) from the 'cardinfo' shell
command.

Change-Id: Idc2ea1d9263f39b3dff403e1535a5e6c4e88b26f
The file was modifiedpySim-shell.py
The file was modifiedpySim/euicc.py
The file was modifiedpySim/app.py
Commit 3dabbafdba2cbfee6528d057220184f857ea8485 by laforge
docs/shell: Mention GlobalPlatform and eUICC commands in overview

Change-Id: I5b6ad752fea09ed9632f150dfbbabf2156a5a9c0
The file was modifieddocs/shell.rst
Commit 56912caac7545276082bd9e48980e0ba33d84007 by laforge
osmo-smdpp: Don't re-encode euiccSigned1/euiccSigned2

We used to re-encode those parts of a decoded ASN.1 struct that is
cryptographically signed in the GSMA SGP.22 specification.  However, if
the received data follows a later spec and contains new/unknown records,
then our poor-man's attempt at re-encoding will render a different
binary, which in turn means the signature check will fail.

Let's instead do a manual step-by-step raw decode of the DER TLV
structure to extract the actual binary information of parts of ASN.1
objects.

Change-Id: I4e31fd4b23ec3be15b9d07c2c30a3e31e22bdda1
Closes: OS#6473
The file was modifiedpySim/esim/rsp.py
The file was modifiedosmo-smdpp.py
Commit 64a5901c4c42a2ca5ef8071cdf938e9e59f25b07 by laforge
osmo-smdpp: Make error message more descriptive

Before this patch we had three different error causes that would cause a
"Verification failed" error message.  Let's state explicitly which part
of verification did actually fail.

Change-Id: I5030758fe365bb802ae367b494aace5a66bc7a91
The file was modifiedosmo-smdpp.py
Commit ddbfc043ac0fd977a0b18f4b729b9211eea4d432 by laforge
add globalplatform.uicc

GlobalPlatform has a [non-public] "UICC Configuration" spec, which
defines some specific aspects of implementing GlobalPlatform in the
context of an UICC.  Let's add some python definitions about it.

Change-Id: If4cb110a9bc5f873b0e097c006bef59264ee48fa
The file was addedpySim/global_platform/uicc.py
Commit 2755b54ded29c8a61babf966ad3e6005d4f64cb2 by laforge
[cosmetic] fix typos in comments

Change-Id: I549ef7002e6ebef3f13af620cad8d03c7f4d891a
The file was modifiedosmo-smdpp.py
The file was modifiedpySim/esim/rsp.py
Commit ee7be445285334ccce1734e003c3222662d922a0 by laforge
utils: Introduce BER-TLV parsers that return raw tag or even raw TLV

In the eSIM RSP univers there are some rather ugly layering violatoins
where ASN.1 cannot be parsed but we have to mess with raw TLVs and the
details of DER encoding.  Let's add two funtions that make it more
convenient to work with this: They return the raw tag as integer, or
even the entire encoded TLV rather than the value part only.

Change-Id: I1e68a4003b833e86e9282c77325afa86ce144b98
The file was modifiedpySim/esim/rsp.py
The file was modifiedpySim/utils.py
Commit fe28a1d87d52920d01168d961009201a2b4647d6 by laforge
esim.bsp: Fix a bug in demac_only_one()

When de-MAC-ing at the recipient side, we must increment the cipher(!)
block number even if no ciphering is done at all.

We did this correctly for MAC (sender) case, but not on the de-MAC
(receiver) case.

Change-Id: I97993f9e8357b36401d435aaa15558d1c7e411eb
The file was modifiedpySim/esim/bsp.py
Commit 80976b65e5a6db49440d4e94a367f4389e69d0af by laforge
esim.saip: Introduce ProfileElement derived classes

It's rather useful to have derived classes implementing specific
functions related to that SAIP profile type.  Let's introruce that
concept and a first example for securityDomain, where methods allow
checking/adding/removing support for SCPs.

Change-Id: I0929cc704b2aabddbc2ddee79ab8b674b1ed4691
The file was modifiedpySim/esim/saip/__init__.py
Commit 77256d0c488b9bdba81099716abb36ee61a68b58 by laforge
esim.saip: Implement SecurityDomainSD.{add,has,remove}_key() methods

This way it's possible to programmatically inspect and modify the
high-level decoded key material inside a securityDomain profile element.

Change-Id: I18b1444303de80eaddd840a7e0061ea0098a8ba1
The file was modifiedpySim/esim/saip/__init__.py
Commit 4d5d2f5849b5769a0adc9104db81ca18f8356f78 by laforge
pySim.esim.saip.validation: Ensure unique PE identification value

Change-Id: I37b9eb4cfb74de79b0493986d976c8a5f8ccd8ea
The file was modifiedpySim/esim/saip/validation.py
Commit bc949649da40effb8cf94a7c50010a428fb60f1f by laforge
esim.saip: Implement ProfileElement.header_name for more PE types

We now cover all PE types as of PE_Definitions-3.3.1.asn

Change-Id: I37951a0441fe53fce7a329066aebd973389cb743
The file was modifiedpySim/esim/saip/__init__.py
Commit 0251367ddb11b533e6f9a8e70455dcd06f646945 by laforge
pySim.esim.saip: Meaningful constructors for [I]SD + SSD

So far the main use case was to read a ProfileElement-SD from
a DER file.  But when we want to construct one from scratch,
we need to have the constructor put some meaningful [default]
values into the class members.

Change-Id: I69e104f1d78165c12291317326dbab05977a1574
The file was modifiedpySim/esim/saip/__init__.py
Commit a3d41a147f36a1f7a75c933748be922896ac083c by laforge
document the CardKeyProvider

Change-Id: Ie6fc24695dd956a4f9fd6f243d3b0ef66acf877b
The file was addeddocs/card-key-provider.rst
The file was modifieddocs/shell.rst
Commit 1aaf978d9f1b290d13a82d7f1efef671f9fc4099 by laforge
CardKeyProvider: Implement support for column-based transport key encryption

It's generally a bad idea to keep [card specific] key material lying
around unencrypted in CSV files.  The industry standard solution in the
GSMA is a so-called "transport key", which encrypts the key material.

Let's introduce support for this in the CardKeyProvider (and
specifically, the CardKeyProviderCSV) and allow the user to specify
transport key material as command line options to pySim-shell.

Different transport keys can be used for different key materials, so
allow specification of keys on a CSV-column base.

The higher-level goal is to allow the CSV file not only to store
the ADM keys (like now), but also global platform key material for
establishing SCP towards various security domains in a given card.

Change-Id: I13146a799448d03c681dc868aaa31eb78b7821ff
The file was modifieddocs/card-key-provider.rst
The file was addedcontrib/csv-encrypt-columns.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/card_key_provider.py
Commit add30ecbfff32ee57a29b2524441e1c532d86fe7 by laforge
global_platform/euicc: Implement obtaining SCP keys from CardKeyProvider

Now that CardKeyProvider is capable of storing key materials
transport-key-encrypted, we can use this functionality to look up the
SCP02 / SCP03 key material for a given security domain.

This patch implements this for the ISD-R and ECASD using a look-up by
EID inside the CSV.

Change-Id: I2a21f031ab8af88019af1b8390612678b9b35880
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/euicc.py
Commit 16749075f9a8e10ec32df7d51058fbac4a5648e3 by laforge
pySim-trace: Add support for the TCA Loader log file format

The "TCA Loader" is a freeware utility program published by the
Trusted Connectivity Alliance for testing SCP80, SCP81, SCP02 and SCP03
in UICCs.  It can generate text log files of the APDUs it exchanges;
let's add this file format to pySim-trace

Change-Id: Ie76d36bb18c6bd8968d2a5b74ec1b8c5ccaaa409
The file was addedpySim/apdu_source/tca_loader_log.py
The file was modifiedpySim-trace.py
Commit 33a6daee6d70c681d468e95b2c4e42e3d17cd233 by laforge
pySim.apdu: Allow TLV based decoders for APDU command and response body

So far we only supported construct.

Change-Id: Ibb80d328c9a1f464aa5338ca0ca1d6bfb00734e1
The file was modifiedpySim/apdu/__init__.py
Commit 5529a41a63b10e181a8392c0de2f1a6052636680 by laforge
pySim.cat: More TLV Definitions for Event Download

Change-Id: I713f12577cab1678cdf97b7ae0e6f3815a42242c
The file was modifiedpySim/cat.py
Commit f22637f151d2c4f7869614c591c885b3a688b571 by laforge
pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.cat TLV

This will decode the ENVELOPE body in pySim-trace further.

Before:

00 ENVELOPE                                             -        9000 {'p1': 0, 'p2': 0, 'cmd': 'd14682028381060291978b3c40048111227ff6407070611535002d02700000281516011212000001eae1bd578fa25791898128811b2206cc71639ca292ec2526da8aef4273d2fe2e', 'rsp': '027100001f0a00000100000001200000ab12800101230d08a0000001510000000f829000'}

After:

00 ENVELOPE                                             -        9000 {'p1': 0, 'p2': 0, 'cmd': [{'smspp_download': [{'device_identities': {'source_dev_id': 'network', 'dest_dev_id': 'uicc'}}, {'address': {'ton_npi': 145, 'call_number': '79'}}, {'sms_tpdu': {'tpdu': '40048111227ff6407070611535002d02700000281516011212000001eae1bd578fa25791898128811b2206cc71639ca292ec2526da8aef4273d2fe2e'}}]}], 'rsp': '027100001f0a00000100000001200000ab12800101230d08a0000001510000000f829000'}

Change-Id: I5ecdbe0b5fa8856cb723569896b73cd49778ed5f
The file was modifiedpySim/apdu/ts_102_221.py
Commit 2eea70f6bc2dc64a285c70d59c78b5449ce5bbaa by laforge
pySim.apdu.ts_102_221: Decode FETCH and TERMINAL RESPONSE body

This gives a meaningful decode during pySim-trace.

Change-Id: Ifa410e1fefc25e87ffa8e3a2230af80180a36a18
The file was modifiedpySim/apdu/ts_102_221.py
The file was modifiedpySim/cat.py
Commit 2c39d81b4bb2baf40f3803fdfd6ff673526b4730 by laforge
pySim/cat: Decode the "Type of Comand" from numeric value to a string

This makes pySim-trace of proactive UICC much more readable.

Change-Id: I833ec02bf281fe49de2be326018e91f521de52c0
The file was modifiedpySim/cat.py
Commit 7b3d4b805c9afc82a3ff50f95744a8df97fc3cbe by laforge
pySim/cat: Fix "Decode the "Type of Comand" from numeric value to a string"

This fixes a bug introduced in Change-Id: I833ec02bf281fe49de2be326018e91f521de52c0

Change-Id: I8b466c123173a5be335df3e1d77ef1c5f717a7d9
The file was modifiedpySim/cat.py
Commit f1495c1e4e00427e68c067bf9e0c027e113cf953 by laforge
esim.es2p: Split generic part of HTTP/REST API from ES2+

This way we can reuse it for other eSIM RSP HTTP interfaces like
ES9+, ES11, ...

Change-Id: I468041da40a88875e8df15b04d3ad508e06f16f7
The file was modifiedpySim/esim/es2p.py
The file was addedpySim/esim/http_json_api.py
Commit 0d1dea01dfea3e1cf85d5a2047097f3d84615b71 by laforge
add pySim.esim.es9p with definitions of the ES9+ HTTP Interface

Let's use the infrastructure of pySim.esim.http_json_api to define
the ES9+ API Functions.  This can in turn be used by clients or even
osmo-smdpp can be ported over to using this infratructure rather than
open-coding a lot of the encoding/decoding of API request/response
parameters.

Change-Id: I194ef1d186391f36245c099cc70a4813185ecf9c
The file was addedpySim/esim/es9p.py
Commit f07161d396a122437bcce39ee4ea9b1ac4c08448 by laforge
http_json_api / es9p: Add User-Agent header

ES9+ (And ES11) require the use of User-Agent, while ES2+ not.

Change-Id: Iffe64d82087940a82fbfa73bf5d2b7e864ae5d67
The file was modifiedpySim/esim/es9p.py
The file was modifiedpySim/esim/http_json_api.py
Commit 888c6e56473941e65c9213989e479b1288fb50d0 by laforge
add contrib/es9p_client: Perform ES9+ client functions like LPA+eUICC

This tool can be used to test the SM-DP+. It implements the full dance
of all HTTPs API operations to get to the downloadProfile, and will
decrypt the BPP to the UPP, which is then subsequently stored as file on
disk.

Needless to say, this will only work if you have an eUICC certificate +
private key that is compatible with the CI of your SM-DP+.

Change-Id: Idf8881e82f9835f5221c58b78ced9937cf5fb520
The file was modifiedpySim/esim/es8p.py
The file was addedcontrib/es9p_client.py
Commit 50d9e2a6d8d577bee80c0d9891dbb99a223bcf84 by laforge
esim.es9p: Suppress sending requestHeader on ES9+

SGP.22 states that ES9+ should not include a requestHeader

Change-Id: Ic9aa874a82241d7b26e2bcb0423961173e103020
The file was modifiedpySim/esim/http_json_api.py
The file was modifiedpySim/esim/es9p.py
The file was modifiedcontrib/es9p_client.py
Commit 0cb0e02c5cb6feaafe28a1ea291a5a7838f9d58e by laforge
esim.saip: Introduce ProfileElement.identification property

Change-Id: I6525bb78619e574296488843e021d505e0632d99
The file was modifiedpySim/esim/saip/__init__.py
Commit 4680503acccab89531d014adb498f2865d30afa0 by laforge
esim.saip: Add ProfileElementSequence.remove_naas_of_type

This method allows the caller to remove all NAAs of a certain type,
for example to remove all CSIM instances from a given profile.

Change-Id: I64438bf0be58bad7a561c3744b7e9b1338a7857c
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedpySim/esim/saip/oid.py
Commit 144bae3f37333cd30f1479d67d7e10641f76f46e by laforge
pySim.tlv: Correctly parse COMPREHENSION-TLV without comprehension bit

The uppermost bit of COMPREHENSION-TLV tags indicates whether the
recipient is required to "comprehend" that IE or not. So every IE
actually has two tag values: one with and one without that bit set.

As all our existing TLV definitions of COMPR_TLV_IE have that bit set,
let's assume this is the default, but use the same definition also for
the situation where that bit is not set.

Change-Id: I58d04ec13be0c12d9fb8cb3d5a0480d0defb6c95
The file was modifiedpySim/tlv.py
Commit 05349a0c65d571eeaf7dca84e394ed9c2ee01265 by laforge
pySim.cat: Make sure to always set comprehension bit in COMPR_TLV_IE

our implementation currently assumes that all derived classes are
created with a tag value that has the comprehension bit set.

Change-Id: I6e5f2a69c960c03015c3f233f8fbc2a7a802f07e
The file was modifiedpySim/cat.py
Commit cdf661b24cfebb63b57405c2b55b3c42a8f277c8 by laforge
pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class misses it

Our current implementation assumes that all COMPR_TLV_IE are created
with a raw tag value that has the comprehension bit set.  Check for this
during the class __new__ method and print a warning if we have to fix it up

Change-Id: I299cd65f32dffda9040d18c17a374e8dc9ebe7da
The file was modifiedpySim/tlv.py
Commit a5634c248b3415d95b4a4cfc6caf54a1de20d5d7 by laforge
jenkins.sh: Include es9p_client in pylint

Change-Id: I06f6773b8b5d3dfa588617d5af81c2fddb474a3d
The file was modifiedcontrib/jenkins.sh
Commit 3b4a673de4f79f5a5be0bd413b8991c1b12697cb by laforge
add contrib/saip-tool.py

This is a tool to work with eSIM profiles in SAIP format.  It allows
to dump the contents, run constraint checkers as well as splitting
of the PE-Sequence into the individual PEs.

Change-Id: I396bcd594e0628dfc26bd90233317a77e2f91b20
The file was addedpySim/pprint.py
The file was addedcontrib/saip-tool.py
The file was modifiedcontrib/jenkins.sh
Commit 4a191089dc02747115e0d299147ba430d2309456 by laforge
pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes

... also add some spec references

Change-Id: If071abdc61c7c881bdea5292d12c74a1024f6784
The file was modifiedpySim/cat.py
Commit 1a9cabbbf008ad919294d815ade3e44cb96c441d by laforge
pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd

Change-Id: I4c4c44002762696b931ed3580ffe54daf62ffa61
The file was modifiedpySim/ota.py
Commit 8bd551af321af3ca3e73a48def87b303e91333fc by laforge
pySim.ota.OtaDialectSms: Move SMS header construct up to class level

this way we can use it in other [future] methods.

Change-Id: If296f823c18864fddcfb9cb1b82a087bac8875d4
The file was modifiedpySim/ota.py
Commit 32401a54e627494e5bf3749559be133739f2da7b by laforge
pySim.ota.OtaDialectSms: Implement command decoding

So far we only implemented command encoding and response decoding.
Let's also add command decoding, which is useful for example when
decoding protocol traces.

Change-Id: Id666cea8a91a854209f3c19c1f09b512bb493c85
The file was modifiedtests/test_ota.py
The file was modifiedpySim/ota.py
Commit 1aa77c5d7457fdb2313d9824c1cced08517427e1 by laforge
tests/ota_test.py: Allow stand-alone execution

Let's add a __main__ section to allow stand-alone execution via
python3 ./tests/test_ota.py

Change-Id: Ic3940ac23c7ddc1013e21f41eae6076a11dfd4f4
The file was modifiedtests/test_ota.py
Commit 5964bdd5a495461816807eba8b6de601405dd132 by laforge
osmo-smdpp: use NIST-P256 by default

The eSIM specs allow for both brainpool and nist; in reality the
deployments use the NIST P256 curve.

osmo-smdpp currently only supports a single certificate; let's use the
NIST one by default.

Change-Id: Idc7809f320505279c8a75e9b667be0a2af802f6b
The file was modifiedosmo-smdpp.py
Commit 5341bf902f1e6d1d08d35a541b25332b99104519 by laforge
unber.py: work-around pylint reporting (possibly-used-before-assignment)

contrib/unber.py:39:22: E0606: Possibly using variable 'content' before assignment (possibly-used-before-assignment)

Change-Id: I725cd5e05e3121c853669eb4bbfe5ba51b79eb75
The file was modifiedcontrib/unber.py
Commit 36276e7b2aeeccb6d71acd90341033a5a96e2eb0 by laforge
contrib/jenkins.sh: Execute pylint also on all contrib python scripts

This way we get linting coverage for sim-rest-{server,client}, eidtool,
unber and others.

Change-Id: I2d6271d493d0f6765e6a184f8ae32f8325317be2
The file was modifiedcontrib/jenkins.sh
Commit f36e9fd39fe8e786a6c0f05c418bb5e1b7bf1c35 by laforge
es9p_client: Use a plausible TAC (copy from lpac)

Some SM-DP+ (notably Idemia) fail if the TAC is not valid.

Change-Id: I48890c4a56147410d0cd5c4e47647b8eb5ad9998
The file was modifiedcontrib/es9p_client.py
Commit ecb65bc2f2f35feba36add7593c62b06379bce2b by laforge
esim.saip: Remove debug print()

Change-Id: I8dfe29302225d951e656d1321bbd249bfe242602
The file was modifiedpySim/esim/saip/__init__.py
Commit 3d70f659f3813f8fc882d4563eb5bcfc01187e10 by laforge
saip-tool: Add new 'info' action to print general information

It will print something like this:

SAIP Profile Version: 2.1
Profile Type: 'GSMA Generic eUICC Test Profile'
ICCID: 8949449999999990023f
Mandatory Services: usim, isim, csim, javacard, usim-test-algorithm

NAAs: mf[1], usim[1], csim[1], isim[1]
NAA mf
NAA usim (a0000000871002ff49ff0589)
        IMSI: 001010123456063
NAA csim
NAA isim (a0000000871004ff49ff0589)

Number of applications: 0

Change-Id: I107d457c3313a766229b569453c18a8d69134bec
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedcontrib/saip-tool.py
Commit b6532b56d2e78be6ac98977b82d63c65879abe34 by laforge
saip-tool: Add 'extract-apps' to dump all applications from eSIM profile

This new action can be used to dump all java applications as either raw
IJC file or converted to CAP format (the usual format generated by
JavaCard toolchains).

Change-Id: I51cffa5ba3ddbea491341d678ec9249d7cf470a5
The file was modifiedcontrib/saip-tool.py
The file was addedpySim/javacard.py
The file was modifiedpySim/esim/saip/__init__.py
Commit 698886247f592cede824984723e78b41a0ef6b64 by laforge
pySim.tlv: Fix ComprTlvMeta() not passing kwargs to parent __new__

This fixes commit cdf661b24cfebb63b57405c2b55b3c42a8f277c8
"pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class misses it"
where we introduce a comprehension-TLV specific derived metaclass, which forgets
to pass the kwargs through to the parent metaclass.

Change-Id: If65a8169bcf91bb2f943d0316f1140e07f0b8b8e
The file was modifiedpySim/cat.py
The file was modifiedpySim/tlv.py
Commit 200bf6eb8bb863737d3268152f25a45465f0af1a by laforge
pySim.esim.saip: Meaningful defaults in PE Constructor + test

Let's make sure the constructor of ProfileElement subclasses set
meaningful defaults to the self.decoded member, so that the to_der()
method can actually encode it.   This is required when constructing
a profile from scratch, as opposed to loading an existing one from DER.

Also, add a test to verify that the encoder passes without exception;
doesn't test the generated binary data.

Change-Id: I401bca16e58461333733877ec79102a5ae7fe410
The file was modifiedtests/test_esim_saip.py
The file was modifiedpySim/esim/saip/__init__.py
Commit c0ea1495558d380ee6d8f74524885a6607fa0ab6 by laforge
pySim.esim: Allow calling compile_asn1_subdir() with non-DER coddec

this isn't needed for the on-wire format, but can be useful for debug
output in GSER or JER.

Change-Id: I1de4b9506a92d60f582c328a180760332584f9e4
The file was modifiedpySim/esim/__init__.py
Commit 292191d67a7449747c666323cab283caa63cd032 by laforge
pySim.esim.saip: Add ProfileElementAKA constructor + methods

This helps us to construct an akaParameter PE from scratch.

Change-Id: I4cc42c98bf82aec085ab7f48aea4ff7efa0eae9e
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedtests/test_esim_saip.py
Commit 992e60902a98d17e6d792904af67416be9e77fab by laforge
tests: Add ProfileElementSD and ProfileElementSSD to test_constructor_encode

Change-Id: Idc6f37b487dfa8a69ac7a50a537cfc317113d501
The file was modifiedtests/test_esim_saip.py
Commit 3c530c3c1a4d6860d6fe7921104a53b4466ffede by laforge
pySim.saip.oid: Properly differentiate optional from non-optional templates

There are e.g. templates for usim and for opt-usim, and they should not
be confused with each other.  Let's reflect that in the naming.

Change-Id: Ic6d04ce3172dc969c6b8c018b8d305eb6fd3f550
The file was modifiedpySim/esim/saip/oid.py
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedpySim/esim/saip/templates.py
Commit 2668eb6148aaa209f97005803823b09224f5534a by laforge
pySim.esim.saip: Add ProfileElementOpt{USIM,ISIM} classes

Change-Id: Iebff2e767baa19f272eeddc62d7d5b3a8f665db5
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedtests/test_esim_saip.py
Commit 3b7e2ae2c1bdeca35f535467120b947b12e982dd by laforge
pySim.saip: Add ProfileElementRFM class

Change-Id: I547e02c12345932deafa4b914fcaeaa183b69798
The file was modifiedtests/test_esim_saip.py
The file was modifiedpySim/esim/saip/__init__.py
Commit 5f9b8a8fc12496118d74f6733f653c4cbaad92b4 by laforge
pySim.esim.saip: Move initialization of PE header to base class

Let's avoid the copy+paste in the subclass constructors and initialize the profile
element header in the base class constructor.

Change-Id: I6e69ae1f0d33d963247fc506db33b3840c10c19a
The file was modifiedpySim/esim/saip/__init__.py
Commit 03aebf5b436e16cc5a1276c1e96856691c0c80a7 by laforge
pySim.esim.saip: ProfileElement{Header,End} classes

Change-Id: I88e18c1ee4907eeac3ae5d04d7bc30d6765f91fa
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedtests/test_esim_saip.py
Commit b5679386d7073652c2784133319aa8fe7cad7344 by laforge
pySim.esim.saip: Add methods to rebuild "mandatory" lists in ProfileHeader

The ProfileHeader PE contain lists of template-oids and services that
are mandatory in this profile.  Let's add methods that can be used to
(re-) compute those lists based on the actual PE contents of the
sequence.

The idea is that during programmatic construction of a profile, those methods
would be called after appending all PEs, just before encoding the
profile as DER.

Change-Id: Ib43db8695c6eb63965756364fda7546d82df0beb
The file was modifiedpySim/esim/saip/__init__.py
Commit 37320da4ab3b1bd7ae1e99a314a13a2fd9b1d408 by laforge
saip-tool: Dump information about security domains from "info" command

output looks like this:

Number of security domains: 1
Security domain Instance AID: a000000151000000
        KVN=0x01, KID=0x01, [SdKeyComp(type=aes, mac_len=8, data=00000000000000000000000000000000)]
        KVN=0x01, KID=0x02, [SdKeyComp(type=aes, mac_len=8, data=00000000000000000000000000000000)]
        KVN=0x01, KID=0x03, [SdKeyComp(type=aes, mac_len=8, data=00000000000000000000000000000000)]

Change-Id: Ia25f5ca6d7e888f7032301dd2561d066a3870010
The file was modifiedcontrib/saip-tool.py
Commit 76b3488829af27ce0e8e0baf2fd9ba64de03f974 by laforge
saip-tool: Also dump RFM information in "info" command

example output:

Number of RFM instances: 2
RFM instanceAID: d276000005aa060200000000b00000 (-> TAR: b00000)
        MSL: 0x16
RFM instanceAID: d276000005aa060200000000b00001 (-> TAR: b00001)
        MSL: 0x16
        ADF AID: a0000000871002ff33ffff8901010100

Change-Id: I534267c7420fc5bd96eaded6078e986161729073
The file was modifiedcontrib/saip-tool.py
Commit 1c2ec93164c6f88f7c3388318c45dc03bc4cb0fb by laforge
pySim.tlv: Add COMPACT_TLV_IE TLV variant

the COMPACT-TLV variant is a TLV variant that ISO7816 uses for encoding
tag and length into a single octet. This is used (for example) in ATR
historical bytes.

Let's add support for this to our pySim TLV encoder/decoder.

Change-Id: I9e98d150b97317ae0c6be2366bdaaeaeddf8031c
The file was modifiedtests/test_tlv.py
The file was modifiedpySim/tlv.py
Commit b865d383aa8a8e84b4842cce88149701afb2ffc3 by laforge
pySim.transport: Fix proactive_handler from_dict() calls

Change-Id: I2aa19ef6a19085d77c1b4f2d434a01ee241bd9a8
The file was modifiedpySim/transport/__init__.py
Commit dacacd206df0fa4bbb791135aed45bd3363bd555 by laforge
pySim.ota: Handle cases where 'secured_data' is empty

while it's true that in situations where response_status == 'por_ok'
we are guaranteed to have a 'secured_data' key in the dict, its value
could well be b'', which in turn causes us to run into an exception,
calling a decoder on an empty byte value; let's avoid that.

Change-Id: I7c919f9987585d3b42347c54bd3082a54b8c2a0a
The file was modifiedpySim/ota.py
Commit 0c40a2245b79f53d1de94d2807e2763b28adbb27 by laforge
pySim.ota: Raise exception if encoded length would exceed 140 bytes

SMS cannot exceed 140 bytes, and TS 31.115 explicitly states that larger
messages must use multi-part SMS, which we don't yet implement here.

Change-Id: I8a1543838be2add1c3cfdf7155676cf2b9827e6e
The file was modifiedpySim/ota.py
Commit 12902730bf4ff216ada3b237a6658071625fb92d by laforge
pySim.commands: Check return value of TERMINAL PROFILE command

Change-Id: Iaede74caf22970869c2c85b42d1e6f70d52c65cb
The file was modifiedpySim/commands.py
Commit c805f00bff35904886d4623205c9ab756efa9c8b by laforge
transport: Implement treatment of 62xx and 63xx warning/error responses

TS 102 221 specifies that (in case of a class 4 command) and as SW
62xx or 63xx, we should send a GET RESPONSE just like in the 61xx
case in order to get the respective response.

As we don't really know if it's a case1/2/3/4 command in the
pySim.transport, let's always send the GET RESPONSE in case SW 62xx or
63xx are received.  It shouldn't hurt - in the worst case there's no
response available...

Change-Id: Ibb1398194a16fc1f1f9bc46af6c66fb6575240cd
The file was modifiedpySim/transport/__init__.py
Commit 5fdfa1463e4cd209fc93867d959931ce16f22006 by laforge
pySim.cat: More spec references + explanations in comments

Change-Id: I4a89156075ae225594740451b33c3dec8983cf04
The file was modifiedpySim/cat.py
Commit 23dd13542e0c8ca6e1afd6305276064967d125f4 by laforge
saip-tool: Fix output of TAR values in "print" subcommand

Change-Id: Ifba1048e3000829d54769b0420f5134e2f9b04e1
The file was modifiedcontrib/saip-tool.py
Commit 96e2a521e942d676dd7bd2af9a403faa8a12d95d by laforge
pySim.esim.http_json_api: 'header' is not always present in response

For example, the ES9+ handleNotification function is defined with an
empty response body, so we cannot unconditionally assume that every HTTP
response will contain a JSON "header" value.

Change-Id: Ia3c5703b746c1eba91f85f8545f849a3f2d56e0b
The file was modifiedpySim/esim/http_json_api.py
Commit 0519e2b7e1c6470c67f6755eef3f74023c0ba734 by laforge
osmo-smdpp: Make sure to return empty HTTP response in handleNotification

SGP.22 is quite clear in that handleNotification shall return an empty
HTTP response body.  Let's make sure we comply to that and don't report
a JSON response.

Change-Id: I1cad539accbc3e7222bfd4780955b3b1ff694c5b
The file was modifiedosmo-smdpp.py
Commit 9d0c2947f14d6737181bfdbe7b46e2d1163d9118 by laforge
es9p_client: Move code into a class; do common steps in constructor

This is in preparation of supporting more than just 'download'

Change-Id: I5a165efcb97d9264369a9c6571cd92022cbcdfb0
The file was modifiedcontrib/es9p_client.py
Commit 3ad3da89954d413f0aa47e5aff0e5bd4d2454607 by laforge
contrib/es9p_client: Add support for reporting notifications to SM-DP+

The ES9+ interface is not only used for downloading eSIM profiles, but
it is also used to report back the installation result as well as
profile management operations like enable/disable/delete.

Change-Id: Iefba7fa0471b34eae30700ed43531a515af0eb93
The file was modifiedpySim/esim/__init__.py
The file was modifiedcontrib/es9p_client.py
Commit 5370178ca2747b1072d5ba3d762f9fd18b765e65 by laforge
osmo-smdpp: Implement 'other' notification signature validation

"other" notifications (enable, disable, delete) contain ECDSA
signatures that also need verification.

Change-Id: If610058b7af6f9fc7822576c93f9970e2ce9aba9
The file was modifiedosmo-smdpp.py
Commit 84077f239f381ef871aba75fceffb72ed974b956 by laforge
osmo-smdpp: Request enable/disable/delete notifications in metadata

this way, the eUICC will send us notifications whenever our profiles are
enabled/disabled/deleted.

Change-Id: I2861290864522b691b30b079c7c2e1466904df2d
The file was modifiedosmo-smdpp.py
The file was modifiedpySim/esim/es8p.py
Commit 03194c08774ed5fc872a691d4cc35e4b01dfafef by laforge
pySim.esim.es8p: Add support for encoding icon in ProfileMetadata

Change-Id: I8c6a0c628f07c2a9608174457d20b8955114731a
The file was modifiedpySim/esim/es8p.py
Commit e18586ddf0c8b5bddef570dcc080c71a603bafe5 by laforge
pySim.globalplatform: Add 'http' submodule for GP Amd B RAM over HTTPS

This implements the first parts of the "GlobalPlatform Remote
Application Management over HTTP Card Specification v2.3 - Amendment B,
Versoin 1.2".  Specifically, this patch covers the TLV definitions for
the OTA message used for HTTPS session triggering.

This also adds some more unit test coverage to pySim.cat, based on
real-world data that was captured nested inside the HTTPS Administration
session triggering parameters.

Change-Id: Ia7d7bd6df41bdf1249011bad9a9a38b7669edc54
The file was modifiedtests/test_tlvs.py
The file was addedpySim/global_platform/http.py
The file was modifiedpySim/cat.py
Commit 92bae20b49a8f3b441dbf1bc821528956876bfd5 by laforge
osmo-smdpp + es9p_client: HTTP status 204 is used for handleNotification

As SGP.22 states, the handleNotification endpoint uses HTTP status 204,
not 200 (due to its empty body).

Change-Id: I890bdbd3e1c4578d2d5f0367958fdce26e338cac
The file was modifiedpySim/esim/es9p.py
The file was modifiedosmo-smdpp.py
Commit 282aeadcc4ff9540d83b5fbba219c72f5182f88e by laforge
pySim.ts_31_103: update to spec v18.1.0 Release 18

This adds two new EFs and one new IST service.

Change-Id: Iced1700046b459399a3e8305e1387ec65eeb3536
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
The file was modifiedpySim/ts_31_103.py
Commit fb56f3554646855e418ae4178c70f7dd6fd5a0ca by laforge
move parts of pySim.ts_31_103 to pySim.ts_31_103_shared

This is requird to make some definitions available to USIM / ts_31_102
without introducing circular dependencies.

Change-Id: I32e29f400d2da047e821bf732316b21805b5a1e2
The file was modifiedpySim/ts_31_103.py
The file was addedpySim/ts_31_103_shared.py
Commit 6f5a0498bfef4893ce026a9c68b9df09693cd726 by laforge
[cosmetic] ts_31_102: Note in comment which release introdcued recent files

Change-Id: I0c1250b532992ae954b1d8ab20993cb9fa947695
The file was modifiedpySim/ts_31_102.py
Commit f174ad688565460b4b9dd2e6c64ef3a88cb2a5f3 by laforge
ts_31_102: Make use of ts_31_103_shared and add Rel 18 files

Change-Id: I68ca15084f9654468bd37526c02a66322085b25b
The file was modifiedpySim/ts_31_102.py
Commit 03eae595a350d8b50189c29146406b3cadd92cbb by laforge
pySim.ts_31_102: Fix name of EF.VBSCA

It's VGCS but VBS.  There's no VBCS.

Change-Id: I3c4a7ec9cd6a56fe7b85832afc68685f8dccbfd1
The file was modifiedpySim/ts_31_102.py
Commit 289d2343fa0f8c2f6df153d24b85593933efd2c5 by laforge
pySim.apdu: Refactor cmd_to_dict() method

Let's factor out the "automatic processing using _tlv / _construct" as a
separate method.  This way we enable a derived class to first call that
automatic processing method, and then amend its output in a second step.

Change-Id: I1f066c0f1502020c88d99026c25bf2e283c3b4f5
The file was modifiedpySim/apdu/__init__.py
Commit d93d774dcc30685dda3df8835850c3c53f34bd10 by laforge
pySim.apdu: Fix APDU CLA matching

The cla values as hex strings must be compared in case insensitive manner

Change-Id: I890bc385d6209e6cfe9b0c38bd9deee7ae50e5f5
The file was modifiedpySim/apdu/__init__.py
Commit 699b49ef1b105ef2a117d0d2d98c509d0b6242b8 by laforge
pySim.apdu.ts_102_222: APDU decoding for administrative commands

Change-Id: I77c97221da19e1a67d96f7cfb69785baefc675c0
The file was modifiedpySim/apdu_source/gsmtap.py
The file was addedpySim/apdu/ts_102_222.py
The file was modifiedpySim/apdu_source/pyshark_gsmtap.py
The file was modifiedpySim/apdu_source/tca_loader_log.py
Commit c800f2a71631cbd4970d668cee26b0295788b7ed by laforge
pySim-trace: display decoded result as JSON, not as python dict

This means users can copy+paste or otherwise post-process the data in a
standard format.

Change-Id: I3135f2f52b8d61684a71b836915b43da5c48422b
The file was modifiedpySim-trace.py
The file was modifiedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
Commit 87b4f99a9085d9e760e63c7ff31d3c42a9697aaa by laforge
pySim.apdu: Get rid of HexAdapter

In the past, we always wrapped a HexAdapter around bytes-like data in
order to make sure it's printed as hex-digits.  However, now that we are
doing JSON output it's much easier to let the pySim.utils.JsonEncoder
take care of this in a generic way.

We should do a similar migration all over pySim (pySim-shell,
filesystem, etc.) - but for now only do it in the low-hanging fruit of
pySim-trace aka pySim.apdu

Change-Id: I0cde40b2db08b4db9c10c1ece9ca6fdd42aa9154
The file was modifiedpySim/apdu/ts_102_221.py
The file was modifiedpySim/apdu/ts_31_102.py
The file was modifiedtests/test_apdu.py
The file was modifiedpySim/apdu/__init__.py
Commit 2cca36e8fdbc111bd0ea5eb46b5a02df40964fd4 by laforge
runtime: add missing docstring

Change-Id: Iee2702c5326f1ec2a32c40b675ba1647387c40c8
Related: OS#6092
The file was modifiedpySim/runtime.py
Commit c78ea1ffa6b0f6d94dc70639d161b1d4e3d3d874 by laforge
runtime: rename get_file_for_selectable to get_file_for_filename

Let's rename get_file_for_selectable to get_file_for_filename so that it
is immediately clear what the method does.

Related: OS#6092
Change-Id: Ifed860814229857ad8b969e50849debbf5d8918f
The file was modifiedpySim/ts_102_222.py
The file was modifiedpySim/runtime.py
Commit 9aeadea4c333f7e23b80ba5be689b6dfcda99b19 by laforge
ts_31_103_shared: fix file structure of EF.WebRTCURI

EF_WebRTCURI should inherit from LinFixedEF intead of TransparentEF.
(See also 3gpp TS 31.103, section 4.2.20)

Related: OS#6092
Change-Id: I903c483a8553fbe599fa7b5a2aefb28bc85b5078
The file was modifiedpySim/ts_31_103_shared.py
Commit f26042f92db924b1ecf59639793b048ba302f1cf by laforge
pySim-shell: fix comment formatting

Related: OS#6092
Change-Id: I101868a6f0220b62977c5e633df2607467cfba91
The file was modifiedpySim-shell.py
Commit 4f2a6ebf1ff6befdab093accea4e64d795e6d92d by laforge
pySim.ota: Add construct definition for SIM File + TK Param definition

Change-Id: Ie5aa2babaf66af49eb5223e5e9d4451089baf055
The file was modifiedpySim/ota.py
Commit 0c022944ff5a10348e100d36e01755c3166d0466 by laforge
pySim.apdu.global_platform: Decode the INSTALL command parameters

Change-Id: I1c323c1cb1be504c6ad5b7efb0fa85d87eaa8cf7
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/apdu/global_platform.py
Commit c60944a7de24ce7bc5ffafed015a83e0f4f47c1a by laforge
saip-tool: Fix TAR display for implicit TAR

Until Change-Id Ifba1048e3000829d54769b0420f5134e2f9b04e1 the TAR
output was working for implicit tar.  With said commit we fixed it
for explicit tar but broke implicit tar.

With this commit it works for both implicit and explicit TAR.

Change-Id: I76133b0e02996a138257f3fba5ceb0d2fc6fad80
The file was modifiedcontrib/saip-tool.py
Commit 34dce409b9489ebf3b9258440f7e2294a25d4cda by laforge
pySim.global_platform.ota: Support KVN 0x70 for SCP02

This is a non-standard extension of sysmocom products.

Change-Id: I00d52f7629aae190ee487ea3453f42b5f94cf42f
The file was modifiedpySim/global_platform/scp.py
Commit d29bdbc2c8fb22f621857254b782594be6273405 by laforge
pySim-shell: move export code into filesystem class model

The code that generates the filesystem export lines for the various
different file structures can be moved into the filesystem class model.

This simplifies the code since we do not need any extra logic to
distinguish between the different file structures.

Related: OS#6092
Change-Id: Icc2ee60cfc4379411744ca1033d79a1ee9cff5a6
The file was modifiedpySim-shell.py
The file was modifiedpySim/filesystem.py
Commit 7858f591fec4047a8083f9a837183589f76fc1ad by laforge
pySim-shell: turn "ADF-escape-code" into an lchan method.

When we traverse the file system using the command "export" we will
also select all ADFs but not all ADFs may have UICC file system support.
This makes it impossible to exit those ADFs again. To exit anyway we
select an application with filesystem support first and then the parent
EF we wanted to select originally. This method may not only be useful
when traversing the filesystem, so let's put it into the RuntimeLchan
class and change it a little so that it would also work if the ADF in
question is an a sub DF.

Related: OS#6092
Change-Id: I72de51bc7519fafbcc71d829719a8af35d774342
The file was modifiedpySim/runtime.py
The file was modifiedpySim-shell.py
Commit 4fefac78b80447e7965583ad22a30f988b13b6f9 by laforge
pySim-shell: fix reset command

The reset command resets the card using the card object. This unfortunately
leaves the RuntimeState uninformed about the event. However, the RuntimeState
class also has a reset method that resets the card and the RuntimeState. Let's
use this reset method. Also fix this method so that it ensures that the SCP is
also no longer present.

Related: OS#6092
Change-Id: I1ad29c9e7ce7d80bebc92fa173ed7a44ee4c2998
The file was modifiedpySim/runtime.py
The file was modifiedpySim-shell.py
Commit dff7bb0687009aafda6016bf5bdeb84e24402b3c by laforge
pySim-shell: clean up method calls in do_switch_channel

The function do_switch_channel method calls methods in RuntimeLchan
that should be private. There is also a code duplication in
RuntimeLchan that should be cleaned up.

Related: OS#6092
Change-Id: Ie5e5f45787abaaf032e1b49f51d447653cf2c996
The file was modifiedpySim-shell.py
The file was modifiedpySim/runtime.py
Commit 43fc87516869572e7c925745ccbdaadb88934628 by laforge
pySim-shell: fix comment formatting

Related: OS#6092
Change-Id: Icea88c061436d26a3240fc666fcc3fe1bd36d2ba
The file was modifiedpySim-shell.py
Commit 2c0e3358a72e25a2e20ed57c97db0342132511f4 by laforge
ara_m: fix sourcecode formatting

Related: OS#6092
Change-Id: I374eefdd1a2763552c98c1928753197e9f753e2b
The file was modifiedpySim/ara_m.py
Commit e931966a066b67267af13b71ef49f2512140a519 by laforge
ara_m: fix misspelled object name

Related: OS#6092
Change-Id: I2c2289658f099aa1d25a4ab3292dea9a7c16c123
The file was modifiedpySim/ara_m.py
Commit 6d2e385acfd555be420d51655456f7dfe5d673b0 by laforge
pySim.esim.saip: Add OID comparison functions

Change-Id: Iab642e0cc6597f667ea126827ea888652f0f2689
The file was modifiedpySim/esim/saip/oid.py
The file was modifiedtests/test_esim_saip.py
Commit d25ea35e7eb1e54a19c728795c1167bd97e766c1 by laforge
pySim.esim.saip: Decode each 'File' element in ProfileElement

When loading a ProfileElement from its DER-ecoded format, populate
a dict with a pySim.esim.saip.File object for each file.

Change-Id: Ie2791c10289eb28daed2904467b0c5e5b11c94c2
The file was modifiedpySim/esim/saip/__init__.py
Commit 75a109419cc8b777d740208fd1d0f0c0ad7932aa by laforge
pySim.tlv: Add convenience methods to IE class

The new methods allow programmatic resolution of nested IEs from
a parent, assuming there's only one child of a given type (which is
often but not always the case).

Change-Id: Ic95b74437647ae8d4bf3cdc481832afb622e3cf0
The file was modifiedpySim/tlv.py
Commit 2a963a7ac0fc12910a9ffff26025fc17f0b8559a by laforge
pySim.runtime: Be more verbose if incompatible method is called

Change-Id: I57190d50a63e0c22a8c5921e1348fae31b23e3d4
The file was modifiedpySim/runtime.py
Commit eda408fba3f6e3a78ba0316e0f1fa5d2ba386fe1 by laforge
pySim.commands: Don't convert SwMatchError to ValueError

In the read and write command implementations, we used to catch
lower-layer exceptions (usually SwMatchError) and "translate" that into
a value error, only to add more information to the exception.  This
meant that higher-layer code could no longer detect this was actually
a SwMatchError exception type.

Let's instead use the add_note() method to amend the existing exception,
rather than raising a new one of different type.

Change-Id: Ic94d0fe60a8a5e15aade56ec418192ecf31ac5e7
The file was modifiedpySim/commands.py
Commit d29f244aad8a7e93f366ae299ce74b535e06697c by laforge
pySim.tlv: Separate {to,from}_val_dict() from {to,from}_dict()

There are some situations where we want to work with a type-name-wrapped
dict that includes the type information, and others where we don't want
that.  The main reason is that nested IEs can only be reconstructed if
we can determine the type/class of the nested IE from the dict data.

Let's explicitly offer {to,from}_val_dict() methods that work with
the value-part only

Related: OS#6453
Change-Id: I81654ea54aed9e598943f41a26a57dcc3a7f10c2
The file was modifiedpySim/tlv.py
Commit de5de0e9db3627e1c885603fa229986ee8e00098 by laforge
pySim-shell: add "fsdump" command

This command exports the entire filesystem state as one JSON document,
which can be useful for storing it in a noSQL database, or for doing a
structured diff between different such dumps.

It's similar to "export", but then reasonably different to rectify a
separate command.

Change-Id: Ib179f57bc04d394efe11003ba191dca6098192d3
The file was modifiedpySim-shell.py
The file was modifiedpySim/exceptions.py
The file was modifieddocs/shell.rst
Commit bff8902ce15ab6b5d739460152f61fce1cdae5fd by laforge
pySim.commands: make use of status word interpreter for CHV

Related: OS#6398
Change-Id: I71efe9d6804c4845bb81f1b3b443215dad0ac301
The file was modifiedpySim/commands.py
Commit f3b3ba15b88d18484be2bd547668b55936519e62 by laforge
pySim.filesystem: Add Path for abstraction/utility around file system paths

Change-Id: I202baa378988431a318850e3593ff1929d94d268
The file was modifiedpySim/filesystem.py
Commit cf65d92039e428ebb3225e8b0ece48221e8e12eb by laforge
pySim.ts_102_221: Fix FileDescriptor encoding for BER-TLV case

This fixes a long-standing bug in the FileDescriptor IE class which so
far only supported decoding, but not encoding of BER-TLV file
descriptors.

Change-Id: I598b0e1709ee004bcf01a53beb91f68470e1f3da
The file was modifiedpySim/ts_102_221.py
Commit e3e964589ff04d84223781c140b09284ed777f9f by laforge
pySim.ts_102_221: Add ProprietaryInformation sub-IEs of TS 102 222

We put those in ts_102_221 because that's where ProprietaryInformation
is defined, and we don't want to risk circular dependencies.

Change-Id: I526acfeacee9e4f7118f280b3549fd04fdb74336
The file was modifiedpySim/ts_102_221.py
Commit e354ef7d050664ef0e41a6a1fd2459121bd19573 by laforge
pySim.esim.saip: Initial support for parsing GenericFileManagement

Change-Id: I4a92f5849158a59f6acca05121d38adc0a495906
The file was modifiedpySim/esim/saip/__init__.py
Commit 8b1060a30e30ad0acd561f15ae58920caace4ca8 by laforge
Reference pySim.filesystem derived classes from SAIP templates

Change-Id: Ia1c810262f1cfa48dae192c7de620c7f0fb69c25
The file was modifiedpySim/esim/saip/__init__.py
Commit 3d6a712e8c670fb099b30579e2018943d4995a1f by laforge
Fix missing AIDs in pySim.saip templates

Change-Id: Ie02e2d27ece0fbd9719468c8d31febd1937468f8
The file was modifiedpySim/esim/saip/__init__.py
Commit 6b1c6a986cd278ae6260ed3fe967313cf6e724fd by laforge
pySim.esim.saip.templates: Build tree from template files

Change-Id: I13e80e9dbddbb145411378a0d9e01461aef75db4
The file was modifiedpySim/esim/saip/templates.py
Commit 4f9ee0fa752599e862703ce6f987a233eeecbe60 by laforge
pySim.esim.saip: Refactor from_der() method to have class_for_petype()

Change-Id: I2e70dddb0b3adb41781e4db76de60bff2ae4fdb7
The file was modifiedpySim/esim/saip/__init__.py
Commit 4fd3fa445cd0fe4448b3f47969f22476015c126a by laforge
pySim.esim.saip: Add subclasses for gsm-access, phonebook, 5gs, saip

Those are all optional ProfileElements related to the USIM NAA.

Change-Id: I621cc3d2440babdc11b4b038f16acf418bbc88ad
The file was modifiedpySim/esim/saip/__init__.py
Commit d3fb38965b6c11461250ce22557f9200c70e7303 by laforge
ara_m: Fix pySim.tlv.IE.from_dict() calls

Historically, to_dict and from_dict were not symmetric; this has been
fixed in I07e4feb3800b420d8be7aae8911f828f1da9dab8 in December 2023.

This however broke the ara_m legacy use of the from_dict() methods.
We've just introduced a from_val_dict() method in
I81654ea54aed9e598943f41a26a57dcc3a7f10c2, let's make use of it.

Change-Id: I3aaec40eb665d6254be7b103444c04ff48aac36d
The file was modifiedpySim/ara_m.py
Commit d81c2086c8866a74d7feb97b258e654545286d84 by laforge
pySim.tlv: Fix from_dict of nested TLVs

The existing logic is wrong.  How we call from_dict() doesn't differ if
a member IE itself contains a nested collection: We always must pass a
single-entry dict with the snak-case name of the class to from_dict().

Change-Id: Ic1f9db45db75b887227c2e20785198814cbab0f5
Fixes: OS#6453
The file was modifiedpySim/tlv.py
Commit 7c06bcdd571a907c1ca833be2019f947219c0c48 by laforge
Support EF.ICCID and EF.PL on classic TS 51.011 SIM

So far we only had the EF.ICCID and EF.PL within our UICC card profile.
However, a classic GSM SIM card is not an UICC, so the CardProfileSIM
also needs those files.

To avoid circular dependencies, move the definitions from ts_102_221.py
to ts_51_011.py

Change-Id: I6eaa5b579f02c7d75f443ee2b2cc8ae0ba13f2fe
Closes: OS#6485
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/ts_51_011.py
Commit fdae0ff90db6f275bb7941b98bc55fc9ec502c55 by laforge
pySim-shell: Support hexadecimal ADM pin in 'verify_adm'

Change-Id: I4191ed79ebe7869d8411d280a32ac2d4bbc210e3
Closes: OS#6480
The file was modifiedpySim-shell.py
Commit 08d7c10211efe06eb5eabc12d6ddaba4d46008db by laforge
pySim-shell: Support other ADMx values beyond ADM1 from 'verify_adm'

Change-Id: Icce6903c1e449889f8bc5003ccfe6af767a26d44
The file was modifiedpySim-shell.py
Commit d3a6bbc215c341962c107227bf431bb975bac456 by laforge
pySim.esim.saip: Add subcasses for EAP, DF.SNPN and DF.5G_ProSe

Change-Id: I8f29e72d387c66c99ceccffc9de23a68fd15dc46
The file was modifiedpySim/esim/saip/__init__.py
Commit 041a1b33fc7ae55868da70a3c0629498c89ad80f by laforge
pySim.esim.saip.template: Permit file-size for BER-TLV files

We previously only permitted this for transparent files (TR), but
file size can of course also be specified for BER-TLV files.

Change-Id: Ie007cf2ccde0a17d0fb853a96b833f064ae52c59
The file was modifiedpySim/esim/saip/templates.py
Commit d2254377b6204f244931c649251425ac0b234cad by laforge
pySim.esim.saip.templates: Add a notion of the path of a file

The SAIP data format is inherently flat and doesn't intrinsically
have an idea of the tree-like structure of a filesystem.  However,
if we want to (for example) convert a physical USIM into an eSIM
profile, we need to find the template for a given file, where the file
is identified by its path.

Let's expose a path property of the FileTemplate object, and populate
that when creating the FileTemplate as part of a ProfileTemplate.

Change-Id: Ie145ba159081daf8fbfa544f6d4248f05b7eea96
The file was modifiedpySim/esim/saip/templates.py
Commit 19328e3bbd6f588af63683a2361041e7cb012ee8 by laforge
pySim.esim.saip.templates: Update to SAIP v3.3.1 (July 2023)

This new TCA SAIP version introduces a number of aditional templates

Change-Id: Ie8aeae3f5b36a3141a70f670c220932389d241a6
The file was modifiedpySim/esim/saip/templates.py
Commit 46bc37fa65056ad1246d466ee773b67ca7c5f0f5 by laforge
pySim.filesystem: Add __len__ method to Path object

This returns the length of the path.

Change-Id: I5e3ba726ed180405c4218ebeee240a3a40527f99
The file was modifiedpySim/filesystem.py
Commit 5b513a543f0d4aa05d61bf8ad5281e058e6b7bce by laforge
pySim.esim.saip.oid: Fix OID defininitions for v3.3.1 IoT templates

Change-Id: Iac620362ae9336199f3b3b168a4bfeda3e2b7c35
The file was modifiedpySim/esim/saip/oid.py
Commit 44d51a7b16de2faf4828a87a9e8284fdab8b0dda by pmaier@sysmocom.de
pySim-shell: fix typo

Change-Id: I1bd995ae9eb59a44a48da62a7b0262faa84a4f2b
The file was modifiedpySim-shell.py
Commit 465d1a07e049cb65ef206bb60ef6cfa4ffabf975 by laforge
pySim.esim.saip.templates: Add SaipSpecVersion

The SAIP specification version implicitly determines which filesystem
templates (or versions thereof) are supported.  So if a given eUICC
states it implements SAIP version 2.3.0, then we have to translate
this into which template versions that means.  The new SaipSpecVersion
and its derived classes do exactly that.

Change-Id: I3a894c72c22e42bd2067e067be80a67197ad1bf2
The file was modifiedpySim/esim/saip/templates.py
Commit ca1b00f99e04c0de1452576b2ec0bc69f266b325 by laforge
pySim.esim.saip.templates: Explicitly specifiy repeatable default value

Change-Id: I9ae2c36f5bffac392c1219bb6ea21c1c05dff4b9
The file was modifiedpySim/esim/saip/templates.py
Commit 8f5fd37b4a117f2be93b831993a726a8ce53f12e by laforge
pySim.esim.saip.templates: Fix '...' notation in default value

The default value must contain '...' to indicate a variable-length
default value section, not '..'

Change-Id: I8d78278065c145b86460acf8eb723babe777c4f6
The file was modifiedpySim/esim/saip/templates.py
Commit 10e9e97724721d1ced82e2ce118b70304a18b1ba by laforge
pySim.esim.saip.templates: Add expand_default_value() method

This method can be used to expand the default value pattern of the
file system template for the file to the specified (record, file) length.

Change-Id: Id3eb16910c0bdfa572294e14ca1cd44ca95ca69f
The file was modifiedpySim/esim/saip/templates.py
Commit 4515f1cf87b22f5493dc25acf2dccb63274a2a25 by pmaier@sysmocom.de
ara_m: fix --apdu-filter setting

The code for the --apdu-filter commandline option is not yet finished.
Let's finish it and make it work.

Related: OS#6092
Change-Id: Ib5fb388972fde0d50c3db0082ebf40bcca404681
The file was modifiedpySim/ara_m.py
Commit 7d9c6583efe8c6f5cb9f49718b85bef332915b7d by laforge
pySim.cards: Make file_exists() check for activated/deactivated

The Card.file_exists() method is only called by legacy pySim-{read,prog}
when it wants to determine if it can read/write a file.  Therefore
it actually doesn't only want to know if the file exists, but also
if it's not deactivated.

Change-Id: I73bd1ab3780e475c96a10cd5dbdd45b829c67335
Closes: OS#6530
The file was modifiedpySim/cards.py
Commit b4530e71b7337fb344a521691959fe756d3f8410 by pmaier@sysmocom.de
filesystem: add placeholder export method in CardFile base class

We add export methods in subclasses of CardFile but the base class
itself lacks an export method. To make the code more readable and
to avoid unnecessary exceptions, les's add a default export method
that just returns a comment.

Related: OS#6092
Change-Id: Ife2a9bad14750db84a87fab907297028c33f1f7d
The file was modifiedpySim/filesystem.py
Commit 03901cc9cea982ef478d7197145522d4f191465c by pmaier@sysmocom.de
filesystem: add export method for ADF files

This patch adds an export method to CardADF, which calls the application
specific export method in CardApplication class

Related: OS#6092
Change-Id: I8129656096ecaf41b36e5f2afbbfbebcd0587886
The file was modifiedpySim/filesystem.py
Commit b92f4f52cca918a76e74524ec8ea37af0a490cf9 by pmaier@sysmocom.de
ara_m: add export support for the ARA-M application

This patch adds an export method to the CardApplicationARAM class.
This method reads the ARA-M configuration and transforms it into
executeable command lines, which can be executed as a script later
to restore an ARA-M configuration.

Related: OS#6092
Change-Id: I811cb9d25cb8ee194b4ead5fb2cabf1fdc0c1c43
The file was modifiedpySim/ara_m.py
Commit 2d235f814309c68d41357c3a9266b4c7cb956778 by pmaier@sysmocom.de
filesystem: fix typo

Change-Id: I17f184bbcf494c5fe944602224cf72d6a22cbc9d
The file was modifiedpySim/filesystem.py
Commit 8597b64ee6a0640be88627e140e051f6ab4c99ec by pmaier@sysmocom.de
runtime: integrate escape route for applications without ADF support

the select_parent method in RuntimeLchan currently implements a way
to escape from an application that has no filesystem support. However,
this escape route can be integrated directly into the select_file
method. This will give us the benefit that it will work transparently
in all code locations.

(This also means we can get rid of the select_parent method again)

Related: OS#6120
Change-Id: Ie6f37d13af880d24a9c7a8a95cef436b603587c7
The file was modifiedpySim-shell.py
The file was modifiedpySim/runtime.py
Commit 12cc6821c46221c510b2d91f86fea05674e5aafc by pmaier@sysmocom.de
runtime: add method to lookup a file by name without selecting it

In some cases it might come in handy to be able to lookup a random file
in the file system tree before actually selecting it. This would be
very useful in situations where we need to check the presence of the
file or if we need to check certain file attributes before performing
some task.

Related: OS#6092
Change-Id: I6b6121e749cea843163659e1a26bb3893c032e29
The file was modifiedpySim/runtime.py
Commit c421645ba6ad77c5039700d8d6cdbecf25602d10 by pmaier@sysmocom.de
pySim-shell: improve export and enable exportation of DF and ADF files

Since we now have the ability to provide export methods for all file
types in the file system (this also includes DF and ADF files), we need
to support this at shell command level as well. Let's also renovate the
walk method and the action method that does the actual exporting.

Related: OS#6092
Change-Id: I3ee661dbae5c11fec23911775f352ac13bc2c6e5
The file was modifiedpySim-shell.py
Commit 526fdae6e5e0840f9ba159422b090d2a40ff5de1 by pmaier@sysmocom.de
pySim-shell: improve fsdump

In the previous patch we have improved the export command. Since
the implementation of the fsdump command is very similar to the
implementation of the export command we can now apply the same
improvements to the fsdump command as well.

Change-Id: I4d2ef7b383025a5bbf122f18ecd51b7d73aaba14
Related: OS#6092
The file was modifiedpySim-shell.py
Commit 89dff98fb6bdfc3b606879a27905037e1f189ade by laforge
pySim.esim.saip.templates: Introduce dependency/hierarchy information

The SAIP specification is very weird in a way that it treats the DF and
EF descriptions as some kind of flat structure without describing the
hierarchy.  So when creating a DF, sometimes it should be created below
the current DF, and sometimes it should be adjacent next to the current
DF.

Let's introduce
* a 'ppath' property of FileTemplate to indicate if a file is anything
  but a direct sibling of the 'base DF' of the PE
* an 'extends' property of ProfileTemplate to indicate that a given
  template does not have its own 'base DF', but that its contents merely
  extends that of another ProfileTemplate
* a 'parent' property of ProfileTemplate to indicate a parent
  ProfileTemplate below whose 'base DF' our files should be placed.

Change-Id: Ieab4835cd21008b289713784c0eb7170af2ccfb9
The file was modifiedpySim/esim/saip/templates.py
Commit 022d562ae1a4686f747292f79334b25266e83835 by laforge
pySim.ts_102_221: Make sure FileDescriptor for BER-TLV contains file_type

before this change, structure == 'ber_tlv' was missing the
file_type == working_ef attribute.  So for linear_fixed, transparent
and cyclic, the file_type attribute was present, but for ber_tlv it was
missing. This is illogical from a user point of vie and makes downstream code
potentially more complex, as it cannot match on working_ef for all EF
types.

Change-Id: If0076cc6dd35a818c08309885f6ef1c1704052c6
The file was modifiedpySim/ts_102_221.py
Commit 97dfcaa9c72447d04390f48432baa7ba939bc96f by laforge
pySim.filesystem: Permit Path object construction from FID integer list

we so far supported construction of the Path object from a string or
a list of strings.  Let's also add the option of constructing it from a
path consisting of a list of integer FID values.

Change-Id: Ia7e9375b3258d1fbfdc892cefba3e3bbe841c550
The file was modifiedpySim/filesystem.py
Commit 1f477495ec534b7e27741b2945123de352a29976 by laforge
saip-tool: Set default log level to INFO (instead of DEBUG)

most users don't want to debug the program.

Change-Id: I54ae558cf8d87bf64cc75431cc4edcc694fa9084
The file was modifiedcontrib/saip-tool.py
Commit b2970d4bbee576c7f454efa2faf810706cb77c50 by laforge
pySim.esim.saip.oid: Allow OID instance in prefix_match()

So far the prefix_match() required a string argument; let's also
permit another OID object to be passed; we internally convert that
to string.

Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a
The file was modifiedpySim/esim/saip/oid.py
Commit 01ddec2fdc92a2058af09c81b3b8c247062c3eb8 by laforge
contrib/saip-tool: Add command-line arguments to configure log level

Change-Id: I4257d7b76193cdaad8c8571ff49f29067e8ab8c8
The file was modifiedcontrib/saip-tool.py
Commit 6d495fb24ddc34507a8777ec45372f8d020ced6e by laforge
pySim.esim.saip: Improve File.from_template feature support

When populating a File from a FileTemplate, let's make sure we
* correctly treat the maximum file size for BER-TLV files
* respect the default value pattern / repeat pattern
* respect the high_update flag.

Change-Id: I3ba092e0893f53a18264dff5fa37b12ccd9bd47e
The file was modifiedpySim/esim/saip/__init__.py
Commit 31c3c9a1e3a1bfc7f95ecdc5c42ed373697730b0 by laforge
pySim.esim.saip: Refactor file size encoding into a method

Change-Id: I46b8cb81ef8cc1794c11b61e0adfb575f937b349
The file was modifiedpySim/esim/saip/__init__.py
Commit 6a1e5eb4ee1dee6f0b093f55df19e0f577a37f08 by laforge
pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass

Having AKA specific code in the generic ProfileElement base class dated
back to when we didn't have a ProfileElementAKA subclass.

Change-Id: Icd332183758b8ef20a77507b728f5e455698def0
The file was modifiedpySim/esim/saip/__init__.py
Commit 3b30994ff0d35a315c2591cca8654a40ad536ba0 by laforge
pySim.esim.saip: pass up **kwargs from ProfileElement sub-class constructors

Change-Id: Ib2b7f6d7428d03e9a8c23af39a61f450096c12bc
The file was modifiedpySim/esim/saip/__init__.py
Commit b349149a88991d18ffc6ddf12fae29f9a309940e by laforge
pySim.esim.saip: Back-reference from ProfileElement to ProfileElementSequence

Store a back-reference to the PE-Sequence in the PE object; this is
neccessary for some upcoming patches, e.g. to determine the position in
the sequence, access the global filesystem hierarchy, etc.

Change-Id: I24b692e47e4dd0afb5a17b04d5e0251dded3d611
The file was modifiedpySim/esim/saip/__init__.py
Commit 3a95fa12f61a4788b1f41011e9795abf6a6bb141 by laforge
pySim.esim.saip: Add some more docstring comments

Change-Id: I70cf2b4dff1952f581efa3b21211c542f43ce565
The file was modifiedpySim/esim/saip/__init__.py
Commit ab3e04fdb18bffea05c24392c67841bfcbeec371 by laforge
pySim.esim.saip: Fix typo in ProfileElementAKA.set_mapping() method

Change-Id: Icd1594c6c2a8536a4ab8d1fc698307f05f539bdb
The file was modifiedpySim/esim/saip/__init__.py
Commit 39613da6a74ac694550d5b0f24f1546923c6867b by laforge
pySim.esim.saip: Fix key used in FsProfileElement.files2pe

The self.files member is a dict.  Hence we should use those dict
keys when [re]building the decoded dict. The previous code ignored
it and re-constructed the key from File.pe_name - but that's not
always identical.

Change-Id: I0e6c97721fb1cfc6b5c21595d85bd374d485b573
The file was modifiedpySim/esim/saip/__init__.py
Commit cd22b9aee3187236447787ebb181840df7f3b0c0 by laforge
pySim.esim.saip.File: move away from stream for file content

Let's linearize the file content in a bytes member variable self.body.

Change-Id: I6cb23a3a644854abd3dfd3b50b586ce80da21353
The file was modifiedpySim/esim/saip/__init__.py
Commit 5e2b93eb55780c81eb4c650be04ed1d9495d332a by laforge
jenkins: use osmo-clean-workspace.sh before and after build

Related: osmo-ci.git I2409b2928b4d7ebbd6c005097d4ad7337307dd93
Change-Id: I5ebebfa27e4b0c7b2fb3aa60618a82c1bfdaa19a
Fixes: OS#6546
The file was modifiedcontrib/jenkins.sh
Commit c6f8457ff1c99065cc1bab79bf9bffcae7b9da6d by laforge
pySim.esim.saip: maintain a parsed fileystem hierarchy

With this change, the ProfileElementSequence object will maintain a
representation of the filesystem hierarchy of the eSIM profile.  Every
file that is added by a ProfileElement will add a FsNode into that tree,
and each FsNode will point to the File object for the respective file.

This allows us to find files by their path, as well as add files by
path.

Change-Id: I2caadc24b1087855f23f3c57cdf8dabbf81757c0
The file was modifiedcontrib/saip-tool.py
The file was modifiedpySim/esim/saip/__init__.py
Commit 6d4c566fd7816a58ee504749964eec109183bf77 by laforge
Fix pySim.esim.es2p.Param.timestamp._encode

************* Module pySim.esim.es2p
pySim/esim/es2p.py:107:19: E1101: Class 'datetime' has no 'toisoformat' member (no-member)

Change-Id: Ib762792d595048bf6d7d6f5acbe2715f137ae5bb
The file was modifiedpySim/esim/es2p.py
Commit a86b1abc03c1f7ecd4434a67b166c65affa1151e by laforge
osmo-smdpp: Proper error handling in case ctxParams1 is missing member

************* Module osmo-smdpp
osmo-smdpp.py:373:15: E0601: Using variable 'iccid_str' before assignment (used-before-assignment)

Change-Id: I52bef18cbcc9f5d14519ff1473532c8502d45908
The file was modifiedosmo-smdpp.py
Commit a5e2a8dbfd9de4ae613494d3e3c9ba01b387b79e by laforge
contrib/saip-tool: Add 'tree' command to display filesystem tree of profile

Change-Id: I5cda7ef814648543c63938ac6a4fb9dba79379ff
The file was modifiedcontrib/saip-tool.py
Commit 89dbdbdccc37d885035fe79f2b4fe95235793dfd by laforge
runtime: fix get_file_by_name

The method get_file_by_name compares the selectable directly with the
given file name. This is not correct. The comparison should be with the
path element from the pathlist.

Related: OS#6092
Change-Id: Id2d0704678935d9b9e2f1aeb6eaccbff6fa9d429
The file was modifiedpySim/runtime.py
Commit 1f920310793bbb2f6b977af88d09ee8d9a2ea95b by laforge
pySim-shell: fix CardKeyProvider for chv management commands

The CardKeyProvider support for the commands enable_chv, disable_chv,
verify_chv, change_chv and unblock_chv is broken. The reason for this
is the annotation "type=is_decimal" in the argument parser. This annotation
prevents the usage of string placeholders ("PIN1", "PUK1", etc).

Let's fix this by finding a better solution. We can also replace any
missing PIN/PUK code by checking if it is supplied or not. If not,
we query the CardKeyProvider. This also makes the usage of the *_chv
commands more uniform with the verify_adm command.

Related: OS#6531
Change-Id: I565b56ac608e801c67ca53d337bdec9efa3f3817
The file was modifiedpySim-shell.py
Commit 585e16a923333e3bfe9150255e0e08b7612a8536 by pmaier@sysmocom.de
filesystem: fix double space in docstring

Change-Id: I69ef171ac2dd2e2717404b1f3b10f986af419f6e
The file was modifiedpySim/filesystem.py
Commit d20be98ed1154cd4a7cf5b9a9e44de4f39fd9a5e by pmaier@sysmocom.de
pySim-shell: fix sourcecode formatting

Change-Id: I7133e93366eaacca5ace301172a08ae84e211c0e
The file was modifiedpySim-shell.py
Commit edf266726d256ff472fbef2dfbfecbd505e586ba by pmaier@sysmocom.de
filesystem: add command to delete all contents from a BER-TLV EF

When working with BER-TLF files, we can only delete one tag at a time.
There is no way to delete all tags at once. This may make working with
BER-TLV files difficult, in particular when scripting is used and the
script needs to start with an empty file. Also export has problems,
since it does not reset the file before setting the new values there
may be unexpected results in case there still tags in the file that
are not set during import. To fill the gap, let's add a commandd that
deletes all tags in a BER-TLV EF at once.

Related: OS#6531
Change-Id: I5d6bcfe865df7cb8fa6dd0052cab3b364d929f94
The file was modifiedpySim/filesystem.py
Commit d5943934a5d539ea021ae4cba39a1a896ac15af7 by pmaier@sysmocom.de
pySim-shell, cosmetic: define positional arguments last

When we define command arguments using the ArgumentParser, we sometimes
define the positional arguments first. However, since positional arguments
usually follow after the optional (--xyz) arguments, we should define the
positional arguments last.

Related: OS#6531
Change-Id: I2412eb6e7dc32ae95a575f31d4489ce210d85ea0
The file was modifiedpySim-shell.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/ts_102_222.py
The file was modifiedpySim/euicc.py
Commit 8c1a1c5cc50a2f51a7cc0ea80c01d0018885569e by pmaier@sysmocom.de
pySim-shell: prevent opening/closing logical channel 0

The basic logical channel 0 is always present. It cannot be created or
closed. Let's restrict the value range of chan_nr, so that only valid
lchan numbers can be passed.

Related: OS#6531
Change-Id: I4eebd9f15fadd18e1caeb033fda36c59446fcab8
The file was modifiedpySim-shell.py
Commit f807983a98c38efc4d2e05acd92e54e206f37390 by laforge
pySim.esim.saip: Add missing entry for 'rfm' to class4petype

Change-Id: I5fec2b026fc6a1197fc1e18d880ea6d10fd4a611
The file was modifiedpySim/esim/saip/__init__.py
Commit 1034a9749f377d7e11393bf0bf7d1454a113ba87 by pmaier@sysmocom.de
global_platform: fix help description for establish_scp03

The argument parser object for establish_scp03 (est_scp03_parser) is
copied from est_scp02_parser. This object still has the .description
property set, which is the description for establish_scp02. To get
the description string that is defined in do_establish_scp03, we must
remove the old description string first.

Related: OS#6531
Change-Id: Ibb26bddf88b2e644a7f0c6b2a06bde228aa8afc7
The file was modifiedpySim/global_platform/__init__.py
Commit cc4c021bb16c9a26581ac9efb13a4348a9f1b70e by pmaier@sysmocom.de
global_platform: use scp_key_identity ICCID for ADF.ISD

Related: OS#6531
Change-Id: I73a6f7088321a2b703074aa5228910709050cab2
The file was modifiedpySim/global_platform/__init__.py
Commit caabee4ccb3113a22251dbc45947a2f00b181a18 by pmaier@sysmocom.de
ara_m: use class byte of current lchan

The ara_m commands use APDUs with a fix class byte (0x80). This means
that all ARA-M related features only work in the basic logical channel.
To fix this, let's compute the class byte for the current logical channel
dynamically inside the send_apdu methods of SimCardCommands. This will
fix the problem globally.

Related: OS#6531
Change-Id: Ie3e48678f178a488bfaea6cc2b9a3e18145a8d10
The file was modifiedpySim-shell.py
The file was modifiedpySim/ara_m.py
The file was modifiedpySim/commands.py
Commit d8637f3a70688c8f0b44e1cdd3f540eea971956b by pmaier@sysmocom.de
commands: get rid of cla4lchan

The send_apdu* methods now support lchan patching, so there is no longer
a need for computing the class byte manually (which is prone get forgotten)
before calling a send_apdu*. It is now enough to supply an APDU that has
a class byte with the default channel selected. This also means we do not
need cla4lchan anymore, so let's restruture the code and get rid of it
completely.

Related: OS#6531
Change-Id: Ia795f3c16a8875484fce3b44e61497d5aa52b447
The file was modifiedpySim/commands.py
The file was modifiedpySim/euicc.py
Commit c595221bc3b92b995f14f2ab0ef742e8a85bcf0d by pmaier@sysmocom.de
scp: fix key length in dek_encrypt and dek_decrypt

When creating the DES cipher object with DES.new, we use the property
card_keys.dek. This property may hold a 16 byte key, but DES uses
an 8 byte key (56 bit + 8 bit integrity). Pycryptodome does not
automatically ignore excess key bytes. Instead it throws an
exception. This means we need to make sure to supply only the first
8 bytes of card_keys.dek

See also: https://pycryptodome.readthedocs.io/en/latest/src/cipher/des.html

Related: OS#6531
Change-Id: I92e0dc6a6196b532bd8b53fca7b9e78070d6903f
The file was modifiedpySim/global_platform/scp.py
Commit a90bf12ea1806d2e3c0476e9e84b40c84744befb by laforge
ts_31_102: Add mssing help string for get_identity parameter --nswo-context

Related: OS#6531
Change-Id: I3ebd3a2ceb7f2580f4cd939b3f002f38f236d7f2
The file was modifiedpySim/ts_31_102.py
Commit 8680698f97478c631e324ea0a06aa5720691fb24 by laforge
suci-tutorial: fix incorrect hnet_pubkey value

The first hnet_pubkey value with the identifier 27 seems to be incorrect.
It differs from the value suggested in 3GPP TS 31.121, section 4.9.4 and
also does not work with the on card SUCI calculation.

The tutorial also contains a reference to 3GPP TS 33.501, Annex C.4. This
spec specifies an ECIES Profile A and an ECIES Profile B. The tutorial
recommends to use a key from profile B, but it actually uses a key from
profile A.

Related: OS#6531
Change-Id: I6fddf8a6efc28ad0d40b1715973429904e00d2b2
The file was modifieddocs/suci-tutorial.rst
Commit e0241037e7673a03425334ddd8a90f202bae9681 by pmaier@sysmocom.de
tests: move unittests into a sub directory

We currently mix the unit-tests with the shell script based integration
tests. Let's put them into a dedicated sub directory.

Related: OS#6531
Change-Id: I0978c5353d0d479a050bbb6e7ae5a63db5e08d24
The file was removedtests/test_esim_bsp.py
The file was removedtests/test_euicc.py
The file was removedtests/test_esim_saip.py
The file was addedtests/unittests/test_tlv.py
The file was addedtests/unittests/test_construct.py
The file was addedtests/unittests/test_esim_bsp.py
The file was addedtests/unittests/test_files.py
The file was removedtests/test_tlv.py
The file was removedtests/test_utils.py
The file was addedtests/unittests/test_utils.py
The file was removedtests/test_construct.py
The file was removedtests/test_ota.py
The file was modifiedcontrib/jenkins.sh
The file was removedtests/test_tlvs.py
The file was addedtests/unittests/test_esim_saip.py
The file was addedtests/unittests/test_euicc.py
The file was removedtests/test_esim.py
The file was addedtests/unittests/test_globalplatform.py
The file was addedtests/unittests/test_esim.py
The file was addedtests/unittests/test_ota.py
The file was addedtests/unittests/test_tlvs.py
The file was removedtests/test_files.py
The file was addedtests/unittests/test_apdu.py
The file was removedtests/test_apdu.py
The file was removedtests/test_sms.py
The file was addedtests/unittests/test_sms.py
The file was removedtests/test_globalplatform.py
Commit 8ac2647004a5c19f9d14b534205fb01bce01474b by laforge
contrib: script to generate "update" commands from diff of fsdumps

Change-Id: I08897cd353093575f98c68580afbc68b6f2f878f
The file was addedcontrib/fsdump-diff-apply.py
Commit eb4ca1189c1410ae3dade2703c78bcd3d0403236 by pmaier@sysmocom.de
tests: move pySim-trace test and its data into a sub directory

We currently have the test data for pySim-trace in pysim-testdata.
This means we mix the test data with the data from our original
pySim integration tests. This is very confusing. Let's put the
test data and the testcase for pySim-trace into a dedicated
sub directory.

Change-Id: I565b4268a05c1a1334b5e7d3fbcd9ef2ef0f0c4c
Related: OS#6531
The file was removedpysim-testdata/pySim-trace_test_gsmtap.pcapng
The file was modifiedcontrib/jenkins.sh
The file was addedtests/pySim-trace_test/pySim-trace_test.sh
The file was removedtests/pySim-trace_test.sh
The file was addedtests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
The file was addedtests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng
The file was removedpysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
Commit 4d99c2b2042bd73d5d7c8878ec47806717de56d1 by pmaier@sysmocom.de
tests: move pySim-prog test and its data into a sub directory

We currently have the shell script that performs the test in the
tests directory and the related data in pysim-testdata directory.
This is confusing, let's have evrything in a dedicated sub directory

Change-Id: Ic995a7f600d164fc0be3c2eb8255dbe043429bea
Related: OS#6531
The file was removedpysim-testdata/Wavemobile-SIM.ok
The file was removedpysim-testdata/sysmosim-gr1.data
The file was removedpysim-testdata/sysmosim-gr1.ok
The file was removedpysim-testdata/Fairwaves-SIM.ok
The file was addedtests/pySim-prog_test/Wavemobile-SIM.data
The file was addedtests/pySim-prog_test/sysmoUSIM-SJS1.data
The file was addedtests/pySim-prog_test/sysmoISIM-SJA2.ok
The file was addedtests/pySim-prog_test/sysmosim-gr1.data
The file was addedtests/pySim-prog_test/sysmoISIM-SJA2.data
The file was removedpysim-testdata/Fairwaves-SIM.data
The file was addedtests/pySim-prog_test/Fairwaves-SIM.ok
The file was addedtests/pySim-prog_test/Fairwaves-SIM.data
The file was modifiedcontrib/jenkins.sh
The file was addedtests/pySim-prog_test/fakemagicsim.ok
The file was addedtests/pySim-prog_test/Wavemobile-SIM.ok
The file was addedtests/pySim-prog_test/pySim-prog_test.sh
The file was removedpysim-testdata/sysmoISIM-SJA2.ok
The file was addedtests/pySim-prog_test/sysmosim-gr1.ok
The file was removedpysim-testdata/sysmoUSIM-SJS1.ok
The file was addedtests/pySim-prog_test/fakemagicsim.data
The file was removedpysim-testdata/fakemagicsim.data
The file was removedtests/pySim-prog_test.sh
The file was removedpysim-testdata/Wavemobile-SIM.data
The file was removedpysim-testdata/sysmoISIM-SJA2.data
The file was removedpysim-testdata/sysmoUSIM-SJS1.data
The file was removedpysim-testdata/fakemagicsim.ok
The file was addedtests/pySim-prog_test/sysmoUSIM-SJS1.ok
Commit df08441472001adc44462c5e45d90d3ebf3b4970 by pmaier@sysmocom.de
suci-tutorial: put download links for specs to the front

The section Technical References has direct download links for the relevant specs.
Then later in th Key Provisioning section another download link follows and another
one is redundant. Let's put all download links into the Technical References section
and then only use the spec numbers in the following. This way we have all download
links in one location.

Related: OS#6531
Change-Id: Ibcbc6bb5d836d32c381922a35afa3b73b5f90621
The file was modifieddocs/suci-tutorial.rst
Commit f0034e4fe8204193fb9549efa215165b2326c25a by pmaier@sysmocom.de
suci-tutorial: fix spec reference

Related: OS#6531
Change-Id: If98c0b1093c7d19ea0278758c635b8405b465a2e
The file was modifieddocs/suci-tutorial.rst
Commit 33256ddfed7c0726f36dfa6ff5e61f31f8b00d2c by pmaier@sysmocom.de
pySim-prog_test: tolerate empty reader slots

The test currently expects all reader slots to be populated. This means
the cards may plugged into a random order, but there may not be any empty
slots in the system at all. This requirement is easy to meet when each
card has its own single-slot USB PCSC-reader, but as soon as multislot
readers are used there may be some empty slots.

Related: OS#6532
Change-Id: I7ba1d1350b6998d65e90408184accdb212556a7c
The file was modifiedtests/pySim-prog_test/pySim-prog_test.sh
Commit 4d1f4fde4fb34f0fed559a0ee1518fcaeb3c743b by pmaier@sysmocom.de
pySim-prog_test: tolerate missing .data files

When the test detects a card, but does not find the .data faile for
it, then it fails. This can be a problem in case we want to intentionally
exclude a specific card model.

Related: OS#6532
Change-Id: Iba196ada0076385de7bffcb157a85fda0a6c1852
The file was modifiedtests/pySim-prog_test/pySim-prog_test.sh
Commit aa182e98157b21c462e8001a59c4a8fedd22ed6e by pmaier@sysmocom.de
pySim-prog_test: supress stderr when probing for cards

When probing for cards, the probing might fail in case the terminal
is empty. This results into lengthy error log output that is not
of interest.

Related: OS#6532
Change-Id: I1d44f9458a05992d79b0152d3affcfeb783cccff
The file was modifiedtests/pySim-prog_test/pySim-prog_test.sh
Commit a437d11135e66b7645021c606c8b2099358302c8 by laforge
contrib/jenkins.sh: Install dependencies before calling pylint

This is the only way we can make sure pylint has all required
information about imports from packages we depend upon.

Change-Id: I29582aa3d7f9ace9ce832d5b907420aaf14881fb
The file was modifiedcontrib/jenkins.sh
Commit a3962b2076d157e075262c51e6c4d0a48ba12465 by laforge
Migrate over to using pyosmocom

We're creating a 'pyosmocom' pypi module which contains a number of core
Osmocom libraries / interfaces that are not specific to SIM card stuff
contained here.

The main modules moved in this initial step are pySim.tlv, pySim.utils
and pySim.construct. utils is split, not all of the contents is
unrelated to SIM Cards.  The other two are moved completely.

Change-Id: I4b63e45bcb0c9ba2424dacf85e0222aee735f411
The file was modifiedcontrib/es9p_client.py
The file was modifiedtests/unittests/test_apdu.py
The file was modifiedpySim/iso7816_4.py
The file was modifiedtests/unittests/test_files.py
The file was removedtests/unittests/test_tlv.py
The file was removedtests/unittests/test_construct.py
The file was modifiedpySim/cat.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedosmo-smdpp.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedtests/unittests/test_sms.py
The file was modifiedpySim/gsmtap.py
The file was modifiedpySim/euicc.py
The file was modifiedpySim/apdu/global_platform.py
The file was modifiedpySim/transport/serial.py
The file was modifiedtests/unittests/test_ota.py
The file was modifiedpySim/esim/bsp.py
The file was modifiedsetup.py
The file was modifiedpySim/global_platform/http.py
The file was modifiedcontrib/csv-encrypt-columns.py
The file was modifiedpySim/global_platform/uicc.py
The file was modifiedpySim/ts_102_310.py
The file was removedpySim/construct.py
The file was modifiedpySim/global_platform/scp.py
The file was modifiedcontrib/saip-tool.py
The file was modifiedpySim-prog.py
The file was modifiedtests/unittests/test_tlvs.py
The file was modifiedpySim/cards.py
The file was removedpySim/tlv.py
The file was modifiedpySim/ts_102_222.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/ts_31_104.py
The file was modifiedtests/unittests/test_globalplatform.py
The file was modifiedpySim/sysmocom_sja2.py
The file was modifiedREADME.md
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/ota.py
The file was modifiedpySim/ts_31_103_shared.py
The file was modifiedtests/unittests/test_esim.py
The file was modifiedpySim/apdu/ts_31_102.py
The file was modifiedpySim-read.py
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/utils.py
The file was modifiedpySim/sms.py
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/ts_31_103.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedrequirements.txt
The file was modifiedpySim/esim/es8p.py
The file was modifiedpySim/runtime.py
The file was modifiedpySim/ts_31_102_telecom.py
The file was modifiedtests/unittests/test_esim_saip.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/secure_channel.py
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedpySim/esim/saip/personalization.py
The file was modifiedpySim/gsm_r.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/card_key_provider.py
The file was modifiedpySim-trace.py
The file was modifiedpySim/apdu/__init__.py
The file was modifiedpySim/commands.py
The file was modifiedtests/unittests/test_utils.py
The file was modifiedpySim/ara_m.py
The file was modifiedtests/unittests/test_esim_bsp.py
The file was modifiedpySim/apdu/ts_102_222.py
The file was modifiedpySim/esim/rsp.py
The file was modifiedpySim/apdu/ts_102_221.py
The file was modifiedpySim/cdma_ruim.py
The file was modifiedcontrib/unber.py
Commit 9036d6d3fbad59ae88e0ba850f90c6dc62ed8b7b by laforge
remove pySim.gsmtap as it has moved to osmopython.gsmtap

Change-Id: I631bb85bc6e76b089004d9f2e2082d70cbccf200
The file was removedpySim/gsmtap.py
The file was modifiedsetup.py
The file was modifiedpySim/apdu_source/gsmtap.py
The file was modifiedpySim/apdu_source/tca_loader_log.py
The file was modifiedpySim/apdu_source/pyshark_gsmtap.py
The file was modifiedrequirements.txt
Commit 52735f36859731703e0e6d6dbd2cffb8316613b8 by laforge
pySim.esim.saip: Fix weird DF names

Sometimes the struct member is called like df-telecom, but in other
cases it's called df-df-saip  with a double 'df' in front.  That makes
no sense, but we have to deal with it from our constructors...

Change-Id: If5e670441f03a47fa34e97a326909b24927c12f7
The file was modifiedpySim/esim/saip/__init__.py
Commit 65cbe48953f1163f49213e881c0ba51b97faf1ab by laforge
pySim.esim.saip: Another naming irregularity.

The choice member is called df-5gprose but the header is called
'df-5g-prose-header' (note the '-' between '5g' and 'prose'). WTF.

Change-Id: I86004ac2e18a187c26c5e470344908512d21fb9e
The file was modifiedpySim/esim/saip/__init__.py
Commit 73dd3d06377e44fc9bf00b49d875af3c19b91fa4 by laforge
pySim.esim.saip: Add missing initialization of File.df_name

Change-Id: Iaf596a8914850ccae584c3b78dc7711db736ac80
The file was modifiedpySim/esim/saip/__init__.py
Commit 981220641d2931e40f8a98da71dd6016cabbd64f by laforge
pySim.esim.saip.File: Turn file_size into a computed property

This way, we can use file_size for both record-oriented and transparent EF

Change-Id: Ib787cabe969202073a8c10042e200f3d2c29db73
The file was modifiedpySim/esim/saip/__init__.py
Commit b22bab0b20d1fc8bf254b4db59f322067ad055d3 by laforge
pySim.esim.saip.ProfileElementGFM: Initialize 'fileManagementCMD'

When constructing a ProfileElmentGFM from scratch, initialize the
decoded['fileManagementCMD'], as it is a mandatory member during
ASN.1 encode.

Change-Id: Iaae99348d36b7f0c739daf039d6ea2305b7ca9db
The file was modifiedpySim/esim/saip/__init__.py
Commit 6aabb92c38541c234e52f10b26cd7c0b592be7c0 by laforge
esim.saip.templates: Fix expand_default_value_pattern for length==0

The original code treated length==0 like length==None (unspecified),
which is wrong.

Change-Id: I39fa1e2b1b9d6d1c671ea37bdbec1d6f97e8a5e7
The file was modifiedpySim/esim/saip/templates.py
Commit bd7c21257c1328c984ac800a3b07c0055cb2c338 by laforge
commands: avoid double lchan patching, get rid of cla_byte getter+setter methods

The SimCardCommands has a cla_byte @property method, which automatically
returns the lchan patched CLA byte. We use cla_byte property to build
the UICC command APDUs inside SimCardCommands and then we hand the APDU
over to the send_apdu* methods. The cla_byte @property method as well
as the send_apdu* methods perform the lchan patching. This means the CLA
byte gets patched twice, which is technically not an issue, but can be
confusing when trying to understand the code.

To fix this, let's remove the @property methods and turn cla_byte into
a normal property again. This is also more accurate since the cla_byte
property originally was introduced to switch between UICC and classic
SIM APDU commands, which have almost identcal APDUs.

Related: OS#6531
Change-Id: I420f8a5f7ff8d9e5ef94d6519fb3716d6c7caf64
The file was modifiedpySim/commands.py
Commit f81331808f9b2dd8872e335a88995296bd169d0a by laforge
pySim-shell: rework startup procedure and introduce non interactive mode

When pySim-shell is used in a scripted environment, we may easily get trapped in
the pySim-shell prompt. This may happen in particular in case the script file
is not executed due to problem with the reader initialization. In such a case
pySim-shell will not exit automatically and the shellscript that was calling
pySim-shell will stall indefinetly.

To make the use of pySim-shell more reliable in scripted environments, let's
add a --noprompt option that ensures the interactive mode is never entered.
Let's also exit with an appropriate return code in case of initialization
errors, so that the calling script can know that something went wrong.

Related: OS#6531
Change-Id: I07ecb27b37e2573629981a0d032cc95cd156be7e
The file was modifiedpySim-shell.py
Commit 471162dc769b11bd71d16775161c174755e1bfd0 by laforge
suci-tutorial: add section about SUCI calculation by the USIM

The tutorial describes how SUCI calculation in the UE is configured,
let's now add a section about SUCI calculation by the USIM.

Related: OS#6531
Change-Id: I45d47f9278b30d99ebde6891de0ba8cc74b1a0a0
The file was modifieddocs/suci-tutorial.rst
Commit 639806cc5aa97225a76ec1dc54ae687a897dd204 by laforge
pySim-shell: do not display 'AIDs:' when there are none

The command cardinfo also displays the AIDs of the card applications.
However, on classic GSM sim cards there are no applications. In this
case cardinfo will still display the string 'AIDs:', but it will of
course not list any AIDs under this string.

Related: OS#6531
Change-Id: Ifb111ce43fdebe85d30857dfc61ab570380b68d1
The file was modifiedpySim-shell.py
Commit 398fdd7e8cba321a6cfcbda180d0287833b5a774 by laforge
pySim-shell: use upper case letters for positional arguments

When we define positional arguments for the argument parser, we usually
use upper case letters only. However, there are some code locations that
use lower case letters. Let's translate those to capital letters to
have a consistent appeariance.

Related: OS#6531
Change-Id: Iec1ff8262bc6e9cf87c3cbf7b32fa5f753b7e574
The file was modifiedpySim-shell.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/ts_31_102.py
Commit ee9ac2f7ff984cdedf5664a2e8d1bc1e9f73ba51 by laforge
suci-tutorial: fix typo s/symo/sysmo/

Change-Id: I0d3bdcf590e8dfef6deabc9967fd2f04152e1020
The file was modifieddocs/suci-tutorial.rst
Commit 726097e51f1052b19bb2d8b5f0ef15c44f01b80c by laforge
transport: define TERMINAL RESPONSE content within ProactiveHandler

So far the core proactive handling code would always generate a positive
response, with no way for the ProactiveHandler call-back to influence
that or to include additional IEs/TLVs.

Let's change that.

Change-Id: Ic772b3383533f845689ac97ad03fcf67cf59c208
The file was modifiedpySim/transport/__init__.py
Commit bf0689a48e774919c97f12e24cc9ae6a88169f58 by laforge
pySim.app: Properly reset card state after reading EID

The code had two problems:

* the RESET was only performed in the successful case, but not if
  some exceptio was raised

* the RESET was a low-level reset bypassing the RuntimeState,
  so the lchan.selected_file was stale afterwards

Fixes: Change-Id Idc2ea1d9263f39b3dff403e1535a5e6c4e88b26f

Change-Id: Ib23d3d5b58b456a25157a622c1010c81cd8b2213
The file was modifiedpySim/app.py
Commit 241d65db126ea3c9e22415ef65c9055261331b26 by laforge
pySim.transport: Add support for generic stdout apdu tracer

Any program using argparse_add_reader_args() will get a new
long-opt '--apdu-trace' which enables a raw APDU trace to the console.

Change-Id: I4bc3d2e023ba360f07f024d7b661a93322f87530
The file was modifiedpySim/transport/__init__.py
Commit 2fe9b6a3e9f997b12bf0042e7620a5a86242d06d by laforge
pySim.transport: Also trace card reset events in ApduTracer

Change-Id: Ia46b65124520eb2b8015dfa3f0a135b497668b92
The file was modifiedpySim-trace.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/modem_atcmd.py
Commit c3fe111c0efd34d855c666c2621456f4a62cf406 by laforge
pySim.commands: use _checksw during get_data() method

All other methods use send_apdu_checksw, just get_data()
was missing the _checksw part.

Change-Id: Ic784bf0c30b22e5e83843aa6694e2706b4b2ac48
The file was modifiedpySim/commands.py
Commit 07b67439f87d9306e722261029b27c3acecdb226 by laforge
pySim.euicc: Add 'get_data sgp02_eid' in ADF.ECASD of M2M eUICC

The M2M eUICC are completely different from the consumer/IoT eUICC.

Obtaining the EID works via GET DATA in the ECASD.  Let's add support
for that.

Change-Id: I6cca6f75d268229244c90b3f1f88e26c89a2b4e0
The file was modifiedpySim/euicc.py
Commit 7633a1123917534c4e9b301dce6dc2084759f79e by pmaier@sysmocom.de
pySim-shell: print cardinfo hexstrings in lowercase

To ensure consistency, let's print the cardinfo hexstrings in lowercase
only.

Related: OS#6531
Change-Id: Ia6a8bd0e700c7fd933fb6c1b1050ed9494462d60
The file was modifiedpySim-shell.py
Commit 492379e61a880159a24d5ec891a127b1ff8addbc by pmaier@sysmocom.de
pySim-prog: fix sourcecode formatting

Change-Id: I0e567a1a681891f33f170c5df50c691b20b6a978
The file was modifiedpySim-prog.py
Commit bd762c77aee72d78b4f60318ab1ab2924989afc5 by pmaier@sysmocom.de
pySim-prog: fix sourcecode formatting

Change-Id: Ie4d4ec6d1752013fa8aa39912aa600c2b4afac74
The file was modifiedpySim-prog.py
Commit 5f2dfc28ff45d979d37d9f799ed2dc526c929f14 by laforge
pySim/profile: Change match_with_profile from static to class method

This was suggested by vyanitskiy during gerrit patch review in
https://gerrit.osmocom.org/c/pysim/+/38049 in order to make the
upcoming eUICC CardProfiles simpler.

Change-Id: Ia7c049b31cb1c5c5bb682406d9dd7a73bcd43185
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/profile.py
The file was modifiedpySim/cdma_ruim.py
The file was modifiedpySim/ts_51_011.py
Commit 72186cce84720ed4eee7f0d719a7c6ce91546644 by laforge
pySim.profile: Further refactor card <-> profile matching

The new architecture avoids sim/ruim/uicc specific methods in
pySim.profile and instead moves the profile-specific code into the
profile; it also solves everything within the class hierarchy, no need
for global methods.

Change-Id: I3b6c44d2f5cce2513c3ec8a3ce939a242f3e4901
The file was modifiedpySim/cdma_ruim.py
The file was modifiedpySim/profile.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/ts_102_221.py
Commit 84857accf3caa50dcc6f793d07aec7044c031ad1 by laforge
pySim-shell: Detect different eUICC types and print during start-up

Change-Id: I54ea4ce663693f3951040dcc8a16bf532bf99c02
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/euicc.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/cdma_ruim.py
Commit 8e42a12048ce0b4dd3e5411887b4e1ce1f0e9f40 by laforge
docs: remove traces of modules migrated to pyosmocom

Change-Id: I2ebb17f9781c90a81e9e554bddd7a851ef51c82a
The file was modifieddocs/library.rst
Commit ad3d73e734e49a2d02bdb8220dfb7b6d86238b0d by laforge
docs: Bring osmo-smdpp documentation up to date with code

Change-Id: Ibaab1fadd5d35ecdb356bed1820074b1b0a1752e
Closes: OS#6418
The file was modifieddocs/osmo-smdpp.rst
Commit 87e1ba6c184b9fb400875a9046cb8cd07ca45b6f by laforge
update pyosmocom dependency to 0.0.3

0.0.3 fixes an important problem related to enabling callers of build_construct()
to pass in a total_len value in order to specify the target output size.

Change-Id: I01687bb54e65bf5cc318745df588c3d6ea14eb83
The file was modifiedsetup.py
The file was modifiedrequirements.txt
Commit 39e4a4b7c5ed6c0a623f7c0c4b28fa9e7ee43633 by laforge
pySim-prog: add FIXME note to tell that writing hlr.db files is broken

The writing to osmo-hlr SQLITE files is broken since the SQLITE format
has evolved over time. Let's add a FIXME note to tell that this needs
fixing.

Related: SYS#4120
Change-Id: I2b23f8bb9f3c2adeb48b010834057f5b4fb1e626
The file was modifiedpySim-prog.py
Commit 3dc04969135132015b77904b997c0d7a71b6511f by laforge
pySim-prog: treat --imsi and --iccid equally

When using a CSV file, we can either read the IMSI or ICCID from the
CSV file before programming. However, should also be possible to
supply both manually to identify the CSV file entry using the --imsi
or --iccid option. This currently only works for the IMSI, but not
for the ICCID.

Related: SYS#4120
Change-Id: Id3083c7794a7bd59501997f22afdc23bad3069e6
The file was modifiedpySim-prog.py
Commit 3eb74829df34059c0dce23b7ca64579bc9c73058 by laforge
pySim-prog: fix commandline parameter check for CSV mode

The CSV mode needs one of the four additional parameters: --imsi
--iccid, --read-iccid or --read-imsi. Also this check is unrelated
to the batch mode. The CSV file parameter reading works independently
from the batch mode.

Related: SYS#4120
Change-Id: I1292afb85122ed2b7944d02ede69c928a453866f
The file was modifiedpySim-prog.py
Commit 94ecf9a92968861ad51d622e24e92d13c30326b6 by laforge
pySim-prog: rework documentation

The documentation for the classic pySim-prog application is a bit
sparse. Let's rework it so that it includes the most important
information that is required to operate pySim-prog. Let's also add
a section about how the batch mode and CSV files are used.

Related: SYS#4120
Change-Id: I1d1a65154cea7fa77428b412fcf8c7b4cba629b1
The file was modifieddocs/legacy.rst
Commit 9a6425b6f277e92745665907c33a0eb598e4554a by laforge
runtime: add new API functions to get the record len and file size

We have an API function to get the number of records, let's now also
add API functions to get the record length and the overall size of
the currently selected file.

Related: OS#5714
Change-Id: Ica7811c04161d8098b40c7219ed6b939df716cfd
The file was modifiedpySim/runtime.py
Commit 6942a40909e6ffb0fa10d0609b04c5cf51e42558 by pmaier@sysmocom.de
filesystem, cosmetic: remove excess whitespace

Change-Id: I902670590ae75a5d197616ae37d8268a60125121
The file was modifiedpySim/filesystem.py
Commit d5ddd04f33ad9413ffc06cc4bc6a8014e297da9b by pmaier@sysmocom.de
pySim-shell: improve command "desc"

The "desc" command displays a string with a file description, let's also
display some size information as part of the description as well.

Related: OS#5714
Change-Id: I98e139ba2bf35df5524245cdd96f5c52cf09b986
The file was modifiedpySim-shell.py
The file was modifiedpySim/runtime.py
Commit 154e29c89a90216678b756f30bf001d431fa4258 by pmaier@sysmocom.de
requirements: require at least construct version 2.10.70

Older construct versions seem to have problems, in particular with
evaluating COptional() correctly. With 2.10.70 no such problems
were observed.

Related: OS#5714
Change-Id: If59dc708a7194649d1f42c4cf33f6328edcb80d2
The file was modifiedrequirements.txt
The file was modifiedsetup.py
Commit dca641aaa277ad8573edd384f1edd794c921d631 by laforge
pySim-prog_test: do not set an ICCID parameter for sysmoISIM-SJA2

The sysmoISIM-SJA2 does not support changing of the ICCID.
pySim-prog will also reject this, so let's remove the ICCID
from the parameter list.

Related: OS#4384
Change-Id: I89571f2bf7c4cec4d621c322a58687b7781b0ed2
The file was modifiedtests/pySim-prog_test/sysmoISIM-SJA2.data
Commit 01a96cd8e464083bfc6c10631b38bc587a5bb101 by laforge
pySim-prog_test: individual ICCIDs for all cards

Our test cards need to stay recognizable, so it is important that
each card has a unique ICCID. This means we must write an individual
ICCID, when we test writing the ICCID.

Related: OS#4384
Change-Id: I858a35e526e7b4868e901222d587258412779f41
The file was modifiedtests/pySim-prog_test/sysmosim-gr1.ok
The file was modifiedtests/pySim-prog_test/sysmosim-gr1.data
The file was modifiedtests/pySim-prog_test/sysmoUSIM-SJS1.data
The file was modifiedtests/pySim-prog_test/sysmoUSIM-SJS1.ok
Commit 26ee39bebf8e26221d85c1e4b7482c10db13d0b6 by pmaier@sysmocom.de
pySim-shell: recognize ADP pins longer than 8 digits as hexadecimal

When a hexadecimal formatted ADM pin is retrieved via the
card_key_provider, it still requires the --pin-is-hex parameter so
that sanitize_pin_adm knows the correct format.

This unfortunately ruins the card_key_provider feature for all cards
that use hexadecimal pins, because the --pin-is-hex would also be
required in scripts, which makes a script either useable for cards
with hexadecimal ADM or for for cards with ASCII ADM.

To minimize the problem, let's recognize all ADM pins longer than 8
digits as hexadecimal in case --pin-is-hex is not set.

Related: OS#4348
Change-Id: Iad9398365d448946c499ce89e3cfb2c3af5d525e
The file was modifiedpySim-shell.py
Commit d7032955c566c10f6cedcdf2aafc134abc4727c3 by pmaier@sysmocom.de
pySim-prog_test: add test vectors for sysmoISIM-SJA5

The sysmoISIM-SJA5 has no testvectors yet

Change-Id: Ia6684ab3ee6c85cfe7bc0ab80d34a26e3499907a
The file was addedtests/pySim-prog_test/sysmoISIM-SJA5.data
The file was addedtests/pySim-prog_test/sysmoISIM-SJA5.ok
Commit f87a00c04f2825cb8f8ea22f7b00ba7a40b72d73 by pmaier@sysmocom.de
Add testsuite for pySim-shell with real cards

This patch adds a comprehensive testsuite for pySim-shell. The testsuite
is based on python's unittest framework in combination with pySim-shell
scripts.

Related: OS#6531
Change-Id: Ieae1330767a6e55e62437f5f988a0d33b727b5de
The file was addedtests/pySim-shell_test/chv/test.py
The file was addedtests/pySim-shell_test/export/__init__.py
The file was addedtests/pySim-shell_test/file_content/test_binary_sim.ok
The file was addedtests/pySim-shell_test/gp/test_est_scp03_csv.script
The file was addedtests/pySim-shell_test/file_admin/activate_deactivate_file.ok
The file was addedtests/pySim-shell_test/ara_m/adf_ara-m_empty.cfg.ok
The file was addedtests/pySim-shell_test/cardinfo/test.template
The file was addedtests/pySim-shell_test/cardinfo/sysmoEUICC1-C2T-cardinfo.ok
The file was addedtests/pySim-shell_test/card_data.csv
The file was addedtests/pySim-shell_test/euicc/euicc_info2.ok
The file was addedtests/pySim-shell_test/euicc/test_get_euicc_info.script
The file was addedtests/pySim-shell_test/file_content/__init__.py
The file was addedtests/pySim-shell_test/lchan/test.script
The file was addedtests/pySim-shell_test/file_specific/ef_imsi.ok
The file was addedtests/pySim-shell_test/euicc/test_list_notif.script
The file was addedtests/pySim-shell_test/verify_adm/test_cmdline.script
The file was addedtests/pySim-shell_test/euicc/euicc_info1.ok
The file was addedtests/pySim-shell_test/authenticate/test.script
The file was addedtests/pySim-shell_test/cardinfo/sysmoISIM-SJA5-S17-cardinfo.ok
The file was addedtests/pySim-shell_test/file_content/test_ber_tlv_uicc.ok
The file was addedtests/pySim-shell_test/gp/test_get_status.script
The file was addedtests/pySim-shell_test/authenticate/__init__.py
The file was addedtests/pySim-shell_test/chv/test_unblock_direct.ok
The file was addedtests/pySim-shell_test/file_content/test_ber_tlv_uicc.script
The file was addedtests/pySim-shell_test/utils.py
The file was addedtests/pySim-shell_test/export/test_export.script
The file was addedtests/pySim-shell_test/file_admin/test.py
The file was addedtests/pySim-shell_test/fsdump/test.script
The file was addedtests/pySim-shell_test/file_admin/test_activate_deactivate_file.script
The file was addedtests/pySim-shell_test/file_content/test_record_uicc.ok
The file was addedtests/pySim-shell_test/euicc/get_profiles_info.ok
The file was modifiedcontrib/jenkins.sh
The file was addedtests/pySim-shell_test/cardinfo/test.py
The file was addedtests/pySim-shell_test/file_content/test_record_sim.script
The file was addedtests/pySim-shell_test/chv/test_manage_direct.template
The file was addedtests/pySim-shell_test/file_specific/test_ef_ust.ok
The file was addedtests/pySim-shell_test/authenticate/test.py
The file was addedtests/pySim-shell_test/README.txt
The file was addedtests/pySim-shell_test/export/test.py
The file was addedtests/pySim-shell_test/export/test_import.script
The file was addedtests/pySim-shell_test/file_content/test_binary_uicc.ok
The file was addedtests/pySim-shell_test/file_specific/test_ef_ust.script
The file was addedtests/pySim-shell_test/gp/get_status_isd.ok
The file was addedtests/pySim-shell_test/ara_m/test.script
The file was addedtests/pySim-shell_test/euicc/test_enable_disable_profile.script
The file was addedtests/pySim-shell_test/lchan/test.ok
The file was addedtests/pySim-shell_test/file_content/test_binary_uicc.script
The file was addedtests/pySim-shell_test/chv/test_unblock_direct.template
The file was addedtests/pySim-shell_test/lchan/__init__.py
The file was addedtests/pySim-shell_test/file_admin/test_create_resize_delete_transparent_ef.script
The file was addedtests/pySim-shell_test/chv/__init__.py
The file was addedtests/pySim-shell_test/file_specific/test.py
The file was addedtests/pySim-shell_test/ara_m/test.py
The file was addedtests/pySim-shell_test/export/export.script.ok
The file was addedtests/pySim-shell_test/get_identity/test.py
The file was addedtests/pySim-shell_test/gp/test_put_delete_key.script
The file was addedtests/pySim-shell_test/fsdump/test.py
The file was addedtests/pySim-shell_test/cardinfo/sysmoSIM-GR1-cardinfo.ok
The file was addedtests/pySim-shell_test/gp/test_est_scp03_direct.template
The file was addedtests/pySim-shell_test/chv/test_manage_csv.ok
The file was addedtests/pySim-shell_test/ara_m/adf_ara-m.cfg.ok
The file was addedtests/pySim-shell_test/euicc/test_get_profiles_info.script
The file was addedtests/pySim-shell_test/euicc/test.py
The file was addedtests/pySim-shell_test/gp/test_est_scp02_direct.template
The file was addedtests/pySim-shell_test/ara_m/__init__.py
The file was addedtests/pySim-shell_test/file_specific/test_ef_ist.script
The file was addedtests/pySim-shell_test/file_content/test_record_sim.ok
The file was addedtests/pySim-shell_test/euicc/test_get_eid.script
The file was addedtests/pySim-shell_test/fsdump/__init__.py
The file was addedtests/pySim-shell_test/navigate_fs/checkpoints_uicc.ok
The file was addedtests/pySim-shell_test/file_content/test_record_uicc.script
The file was addedtests/pySim-shell_test/lchan/test.py
The file was addedtests/pySim-shell_test/navigate_fs/test_uicc.script
The file was addedtests/pySim-shell_test/euicc/get_eid.ok
The file was addedtests/pySim-shell_test/file_specific/test_ef_ist.ok
The file was addedtests/pySim-shell_test/euicc/test_gen_notif.script
The file was addedtests/pySim-shell_test/navigate_fs/__init__.py
The file was addedtests/pySim-shell_test/chv/test_unblock_csv.script
The file was addedtests/pySim-shell_test/ara_m/adf_ara-m.script.ok
The file was addedtests/pySim-shell_test/authenticate/auth_result.ok
The file was addedtests/pySim-shell_test/cardinfo/__init__.py
The file was addedtests/pySim-shell_test/verify_adm/test.py
The file was addedtests/pySim-shell_test/gp/__init__.py
The file was addedtests/pySim-shell_test/euicc/test_rm_notif.template
The file was addedtests/pySim-shell_test/euicc/test_set_nickname.script
The file was addedtests/pySim-shell_test/verify_adm/test_csv.script
The file was addedtests/pySim-shell_test/file_content/test_binary_sim.script
The file was addedtests/pySim-shell_test/file_specific/test_update_imsi_plmn.script
The file was addedtests/pySim-shell_test/file_admin/test_create_delete_df.script
The file was addedtests/pySim-shell_test/euicc/enable_disable_profile.ok
The file was addedtests/pySim-shell_test/gp/test.py
The file was addedtests/pySim-shell_test/file_specific/__init__.py
The file was addedtests/pySim-shell_test/navigate_fs/test_sim.script
The file was addedtests/pySim-shell_test/euicc/__init__.py
The file was addedtests/pySim-shell_test/gp/key_information.ok
The file was addedtests/pySim-shell_test/navigate_fs/checkpoints_sim.ok
The file was addedtests/pySim-shell_test/euicc/notifications.ok
The file was addedtests/pySim-shell_test/get_identity/__init__.py
The file was addedtests/pySim-shell_test/get_identity/test.script
The file was addedtests/pySim-shell_test/fsdump/fsdump.json.ok
The file was addedtests/pySim-shell_test/navigate_fs/test.py
The file was addedtests/pySim-shell_test/verify_adm/test_direct.template
The file was addedtests/pySim-shell_test/file_admin/__init__.py
The file was addedtests/pySim-shell_test/chv/test_unblock_csv.ok
The file was addedtests/pySim-shell_test/file_admin/test_create_resize_delete_linear_fixed_ef.script
The file was addedtests/pySim-shell_test/chv/test_manage_direct.ok
The file was addedtests/pySim-shell_test/config.yaml
The file was addedtests/pySim-shell_test/cardinfo/sysmoISIM-SJA2-cardinfo.ok
The file was addedtests/pySim-shell_test/gp/test_est_scp02_csv.script
The file was addedtests/pySim-shell_test/euicc/set_nickname.ok
The file was addedtests/pySim-shell_test/__init__.py
The file was addedtests/pySim-shell_test/chv/test_manage_csv.template
The file was addedtests/pySim-shell_test/verify_adm/__init__.py
The file was addedtests/pySim-shell_test/file_content/test.py
Commit c09d4cc6b80b8eccf18c363843288f5f3d436fbf by Oliver Smith
gitignore: add files generated with jenkins.sh

Change-Id: Iaffe04a3dfebd46efc479dc3665fd67f2c95f375
The file was modified.gitignore
Commit 7b95fac0221dfb2b78d37da0165381408066ba71 by Oliver Smith
contrib/jenkins: add SKIP_CLEAN_WORKSPACE

In order to run this script from pyosmocom's contrib/jenkins.sh script,
we want to skip the clean workspace step. Add an environment variable to
do that.

Related: OS#6570
Change-Id: Ic8dc9b85da17719195f7374d37eccb4dedba6ce8
The file was modifiedcontrib/jenkins.sh
Commit d96d04718e3e4937379a5f646f7c8e25c41b81f2 by pmaier@sysmocom.de
pySim-shell_test: disable test_list_and_rm_notif

The testcase euicc.test_list_and_rm_notif fails due to a problem
with the eUICC. The eUICC reports the following error when a
delete notification attempt is made:

"delete_notification_status": "undefinedError"

Let's temporarily disable this testcase until the problem is resolved.

Change-Id: I7d0b6a998499d84f0eb4e24592ad43210ac54806
The file was modifiedtests/pySim-shell_test/euicc/test.py
Commit 78c22a7d635de4db9feaca36d85d89817494a425 by laforge
pySim-shell: New '-e' command line argument

Using '-e' it is possible to specify *multiple* pySim-shell commands
which shall be executed at startup.  This extends the current ability
to execute just a single command.

Example:
./pySim-shell.py -p0 -e 'select ADF.USIM/EF.IMSI' -e 'read_binary_decoded'

Change-Id: I74004f46105553f077c039ca0f86f75afccc7342
The file was modifiedpySim-shell.py
Commit efddffe0158c50b6c36b5fd76795c89350921793 by pmaier@sysmocom.de
filesystem: pass total_len to construct of when encoding file contents

In our construct models we frequently use a context parameter "total_len",
we also pass this parameter to construct when we decode files, but we
do not pass it when we generate files. This is a problem, because when
total_len is used in the construct model, this parameter must be known
also when decoding the file.

Let's make sure that the total_len is properly determined and and passed
to construct (via pyosmocom).

Related: OS#5714
Change-Id: I1b7a51594fbc5d9fe01132c39354a2fa88d53f9b
The file was modifiedpySim/gsm_r.py
The file was modifiedpySim/runtime.py
The file was modifiedpySim/ts_31_102.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/sysmocom_sja2.py
The file was modifiedtests/unittests/test_files.py
The file was modifiedpySim/ts_31_102_telecom.py
The file was modifiedtests/pySim-shell_test/file_content/test_record_uicc.ok
Commit 4045146f62b331a2819e831cbe3b040a060c4e91 by pmaier@sysmocom.de
cosmetic: use **kwargs instead of **_kwargs

Some methods sometimes have a **_kwargs parameter, let's be consistent
and use **kwargs only.

Related: OS#5714
Change-Id: I98857cc774185e55a604eb4fbfbf62ed4bd6ded7
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/ts_31_102.py
Commit 39552464d8097023b4cef861b0ab216b390ef4c2 by pmaier@sysmocom.de
ts_51_011: replace encoding of EF.MSISDN with construct model

The encoding of EF.MSISDN is currently done with enc_msisdn and
dec_msisdn from utils.py. Let's replace this with a construct
based model, similar to the one we already use with EF.ADN

Related: OS#5714
Change-Id: I647f5c63f7f87902a86c0c5d8e92fdc7f4350a5a
The file was modifiedpySim/ts_51_011.py
The file was modifiedtests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
Commit dc2ca5d6be4ac435b0c6b73ac0bd82df973131a6 by pmaier@sysmocom.de
ts_51_011: fix unittest for EF.ADN

The unittest for EF.ADN can run with _test_de_encode. However, the original
test vectors seem to be from a card with a slightly larger record size, so
they need a bit of re-alignment

Related: OS#5714
Change-Id: I241792e66ee6167be6ddc076453344b6307d6265
The file was modifiedpySim/ts_51_011.py
Commit 10ea4a07141b1f970373367d38d1f8b726e6e015 by pmaier@sysmocom.de
ts_51_011: use _test_de_encode instead of _test_decode in EF.CFIS unittest

The unittest for EF.CFIS only runs with _test_decode, but it also runs with
_test_de_encode without any problems

Related: OS#5714
Change-Id: Ib876fd799f871fe64ced2a7b64847ffd09e16ed9
The file was modifiedpySim/ts_51_011.py
Commit 1f45799188e4b61fcbe7aaff8af4611789a03c5e by pmaier@sysmocom.de
ts_102_221: se _test_de_encode instead of _test_decode in EF.DIR unittest

The unittest for EF.DIR only runs with _test_decode, but it also runs with
_test_de_encode without any problems

Related: OS#5714
Change-Id: If459073c6ff927c1cc1790d506e3979243b1fb4c
The file was modifiedpySim/ts_102_221.py
Commit 93c89856c825139e8ead856b4439f24e2851418a by pmaier@sysmocom.de
utils: move enc_msisdn and dec_msisdn to legacy/utils.py

We now have a construct based encoder/decoder for the record content
of EF.MSISDN. This means that we do not need the functions enc_msisdn
and dec_msisdn in the non-legacy code anymore. We can now move both
to legacy/utils.py.

Related: OS#5714
Change-Id: I19ec8ba14551ec282fc0cc12ae2f6d528bdfc527
The file was modifiedpySim/utils.py
The file was modifiedpySim/legacy/utils.py
The file was modifiedtests/unittests/test_utils.py
The file was modifiedpySim-read.py
The file was modifiedpySim/legacy/cards.py
Commit 7429bc0ca08d9eb9a65974e05d2d27e001edfd84 by laforge
tests: sanitize all cards before running tests

Even though our tests are written in a way that they shouldn't interfere
with each other, it may happen that one testrun writes content to a file
that upsets a different testrun. The resulting problems are often
difficult to diagnose.

To minimize the problem, let's add code that can reset the cards to a
defined state. This can be done using pySim-shell's export
feature. We can generate a backup from a known good state and then play
back the backup to reset files that have been changed. Files that didn't
change will not be written thanks to the conserve_write feature of
pySim-shell.

Related: OS#4384
Change-Id: I42eaf61280968518164f2280245136fd30a603ce
The file was addedtests/card_sanitizer/card_backup_3b991800118822334455667760_2222334455667788990.script
The file was addedtests/card_sanitizer/card_data.csv
The file was addedtests/card_sanitizer/card_backup_3b9f96801fc78031a073be21136744220610000001a9_8988219000000117833.script
The file was addedtests/card_sanitizer/card_backup_3b9f95801fc78031e073f62113674d4516004301008f_89445310150011013678.script
The file was addedtests/card_sanitizer/card_sanitizer.py
The file was addedtests/card_sanitizer/card_backup_3b9f96801f878031e073fe211b674a4c753034054ba9_8988211000000467343.script
The file was addedtests/card_sanitizer/card_backup_3b9a940092027593110001020221_1122334455667788990.script
The file was addedtests/card_sanitizer/card_backup_3b9f96801f878031e073fe211b674a357530350265f8_8949440000001155314.script
The file was addedtests/card_sanitizer/card_backup_3b9f96801fc78031a073be21136743200718000001a5_8988211320300000028.script
Commit 7c62fc5ec402f29344092fc54bfd36d62578bb2e by pmaier@sysmocom.de
jenkins: build docs in virtualenv as well

The build system uses a virtual environment, in which it installs
pysim and its dependencies. This is done for the integration tests,
but not when building the sphinx documentation. However, the
documentation build process also invokes pysim code to generate
documentation from the docstrings. This means we need pysim with
all its dependencies for the doc building as well.

Change-Id: I6381eeef7fa19873ca0cc330a0ab43b7ef5096e4
Related: SYS#7094
The file was modifiedcontrib/jenkins.sh
Commit a8cfeb0111c263f1163b8a84e14ade5486fadb2a by Oliver Smith
docs/Makefile: make SPHINXBUILD work in venv

sphinx-build doesn't use the PYTHONPATH from the venv, unless it runs
as python3 -m sphinx.cmd.build. We need it to use the imports from
PYTHONPATH, so we can update the pyosmocom version in requirements.txt
in a patch, and this new version will be used in the jenkins job that
runs during gerrit review. Otherwise the previously installed version
(from the docker image) will be used.

Related: https://github.com/sphinx-doc/sphinx/issues/8910
Change-Id: I487e1af6a3493df5b806cc2d3d2b70bc5233b89f
The file was modifieddocs/Makefile
Commit 3a905d637c00d707f635d0f138cbbf0301b900e3 by Oliver Smith
pySim.euicc: Fix ASN.1 encoding of integer values

Change-Id: I26ee41705f5e95c5fa3a9997cbaebdacca3e89a7
Closes: SYS#7094
The file was modifiedpySim/euicc.py
The file was modifiedrequirements.txt
The file was modifiedsetup.py
Commit 82b0f1b39a3a5ee85e063266214002dc9d5441a3 by Oliver Smith
pySim-shell_test: re-enable test_list_and_rm_notif

The problems with test_list_and_rm_notif (see also change id
I7d0b6a998499d84f0eb4e24592ad43210ac54806) are now resolved, so
we can re-enable the testcase now.

Closes: SYS#7094
Change-Id: I95eb3b9c02a69653797851197e882ea9316805fc
The file was modifiedtests/pySim-shell_test/euicc/test.py
Commit f4dd9b5cebf41371dc8d8377e5496f7ab0dee514 by laforge
docs/shell: Add missing :ref: when referencing other command

Change-Id: I18f110e6313932d82b19ecaa7e07ef00c2339513
The file was modifieddocs/shell.rst
Commit f9631fb361527d7c2dac1cd93fb309c9d6d99204 by laforge
pySim.esim.saip.templates: Fix DF_TELECOM FileID (7F10, not 7F11)

Change-Id: I4bc37f9d99c046cd6c6accaaf460a39eb79b660f
The file was modifiedpySim/esim/saip/templates.py
Commit ba22e238f3fe88d384502181e2422789b46c1f94 by pmaier@sysmocom.de
global_platform: ensure ArgumentParser gets a list for choices

When we use the argument parser with choices, we sometimes use a
list that we derive from a dictionary. However if we do that we
still must ensure that we really put a list and not a dict_values
or dict_keys class as parameter because this won't work any longer
with cmd2 version 2.5.0

Related: OS#6601
Change-Id: I165fefd8feb0d96cedc15d036fb32da381f711b3
The file was modifiedpySim/global_platform/__init__.py
Commit 12328c090d60359ded0817288f654d864ac52525 by pmaier@sysmocom.de
pySim.ts_31_102: Add support for EF.EARFCNList

This adds a construct + pyosmocore.tlv based declarative encoder/decoder
for the EF.EARFCNList file used in the context of NB-IoT in later
release USIMs.

Change-Id: I16797ca58c3ad6ebaf588d04fec011a0cbcfcef3
The file was modifiedpySim/ts_31_102.py
The file was modifiedtests/pySim-shell_test/fsdump/fsdump.json.ok
The file was modifiedtests/pySim-shell_test/export/export.script.ok
The file was modifiedtests/pySim-shell_test/file_specific/test_ef_ust.ok
Commit d8d52bdf77209eb392875d71b0713c233360d740 by laforge
pySim-shell_test/utils: delete log files in general

When we get rid of temporary files, we delete those using a wildcard,
but for the logs from pySim-shell we explicitly memorize the name
of the pySim-shell logfile and delete it later by this explicit
name. This is not necessary, let's just delete all log files present
using a wildcard.

Related: OS#6601
Change-Id: I09dc7e59d1a3dcb68f54e3a8dccb86a1bc6c9ee6
The file was modifiedtests/pySim-shell_test/utils.py
Commit 32d6a9ab5fab4407c0d4aca72b2e41496ffe56a5 by laforge
pySim-shell_test/utils: enumerate pySim-shell logs

When pySim-shell is called by a testcase, a logfile is createted. The logfile
filename contains the testcase name. However, a testcase may run pySim-shell
multiple times. In this case we overwrite the log from previous run. Let's use a
counter to generate unique file names for each run, so that we won't lose logs
from previous runs.

Related: OS#6601
Change-Id: Ib2195d9b2231f74d0a6c4fb28f4889b6c45efb1e
The file was modifiedtests/pySim-shell_test/utils.py
Commit 98f4ea1447567e16c250161d42ab4e2d35534371 by laforge
pySim-shell_test/utils: display pySim-shell logfile content

When we configure the tests to display file content, we only display files that
we compare, let's also display log file contents from pySim-shell. This will
be useful in situations where we only have log output from the tests, but no
access to the file system of the test host.

Related: OS#6601
Change-Id: Ibf6f78d7e71c213c7ca1caaf21c4c890e892261e
The file was modifiedtests/pySim-shell_test/utils.py
Commit 5d54f3b8d8b435c1966abf0e22ca03fd01053078 by pmaier@sysmocom.de
commands: fix typo

Change-Id: I4103b7474063a26f09666361aef72abcd35bc12d
The file was modifiedpySim/commands.py
Commit 909b8c1611ebfa710cc9ab3827bf17f4b9944581 by pmaier@sysmocom.de
global_platform/scp: fix typo

Change-Id: Ib26d983c6a80419326de812af2781c5e710dbcfc
The file was modifiedpySim/global_platform/scp.py
Commit 464d1ac2bef05e78909386a97b887421b8dd6968 by pmaier@sysmocom.de
commands: fix double space character in apidoc

Change-Id: Id0dbe4578fd212bc240aac80e1e416cb57e92cc7
The file was modifiedpySim/commands.py
Commit 35b9b3c54239e2c3f39d960b279a92523e3b1429 by pmaier@sysmocom.de
commands: fix apidoc (wrong order of parameters)

Change-Id: I4d17c71c7f992ecd795dd214d34f2e094c0a5b53
The file was modifiedpySim/commands.py
Commit 59593e0f28b7b10d667c87a6d6d7c5a515f97a69 by pmaier@sysmocom.de
pySim-shell-test: improve global platform tests

The tests that check the establishment of a secure channel currently only test
security level 3. Also the get_data command after it only tests data reception
from the card.

Let's extend the test coverage and test the SCP establishment for security
level 1 as well. Let's also add a get_status command to make sure sending data
to the card also works (without exceptions).

Related: OS#6367
Change-Id: Idff40b414a249e532df1bdce2a8deb9b0cb9718f
The file was modifiedtests/pySim-shell_test/gp/test_est_scp03_direct.template
The file was modifiedtests/pySim-shell_test/gp/test_est_scp02_csv.script
The file was modifiedtests/pySim-shell_test/gp/test_est_scp02_direct.template
The file was modifiedtests/pySim-shell_test/gp/test_est_scp03_csv.script
Commit f4c156ae575a6cd0da434150292bb7cd665a64df by pmaier@sysmocom.de
global_platform/scp: mapdu may be undeclared

when we sign and encrypt the APDU in _wrap_cmd_apdu (SCP03) we return an "mapdu"
at the end. However, in the (unlikely?) case where self.do_cencand
self.do_cmac are false, mapdu will be undeclared. In _wrap_cmd_apdu for SCP02
we just re-use the apdu variable and return it at the end, so when no
encryption and no signing is applied, the APDU falls just through without any
modifications. We should have the same mechanism for the SCP03 wrapping as
well.

Related: OS#6367

Change-Id: Ic7089a69dffd7313572c5b3e5953200be5925766
The file was modifiedpySim/global_platform/scp.py
Commit 882e24677ff0532d4967b1480c826cad2d0ec1f5 by pmaier@sysmocom.de
pySim-shell_test/utils: print logfile on all types of errors

When pySim-shell has problems starting up, it exits with an error
code. This is detected by the testsuite, but it also causes an
early exit, so that the log file content are not printed.

Change-Id: Ic0f34eda32a7c557810abcb05a84e343741fdb8a
The file was modifiedtests/pySim-shell_test/utils.py
Commit 5887fb70fb34d085ecd76562efd13ed74f1cc822 by pmaier@sysmocom.de
pySim-shell: allow checking of APDU responses

The "apdu" command allows us to send custom APDUs to a card. This command is
often used in low level initialization scripts or tests. To stop the script
execution in case of an error, the command allows us to specify a status word
that must match the status word of the response. But we have no such mechanism
for the response itself. Let's add another parameter where we can pass a regex
that the response must match.

Related: OS#6367
Change-Id: I97bbcdf37bdcf00ad50a875b96940c211de7073d
The file was modifiedpySim-shell.py
Commit daa1c74047bb3155b3340bf216fbca8c514c2ddd by pmaier@sysmocom.de
pySim-shell: fix reset command for no-profile mode

There are situations where no card profile can be determined. In this case no
RuntimeState will be present. This is in particular the case when pySim-shell
is used on a card that is not provisioned/initialized yet. In those cases we
have to go the direct route and reset the card directly.

Related: OS#6367
Change-Id: I27bf9fdb131d8bdeba07f4dfd2b76b38f9bfdd17
The file was modifiedpySim-shell.py
Commit ec30022b1a6e5f3a87822eba2e6616a792130707 by pmaier@sysmocom.de
pySim-shell: add new commandline option "--skip-card-init"

by default pySim-shell does all kinds of probing and file selection
on startup. This is to determine the card type and to find a suitable
card profile. However, in case the card is non yet provisioned this
probing may cause a error messages and even might upset the cards
internal state. So let's have a commandline option thrugh which we
can instruct pySim-shell to skip any initialization and to give us
a prompt immediately, so that we can enter custom APDUs

Related: OS#6367
Change-Id: I1d8a57de201fe7ad7cbcbc6f72969ea8521e821d
The file was modifiedpySim-shell.py
The file was modifiedtests/pySim-shell_test/utils.py
The file was modifiedpySim/app.py
Commit 30c59fce42714ac122bfa003d87f30c4908e641c by pmaier@sysmocom.de
pySim-shell_test/utils: treat cmd2 error "not a recognized command... as exception

When a pySim-shell command is not recognized, cmd2 prints "xyz is not a
recognized command, alias, or macro." This string is a normal print out
and not an exception, but during tests, it may point out a severe problem
and therefore it should be tread like an exception.

Related: OS#6367
Change-Id: I17be6af1547b31170622e17b9cfb9c492597670d
The file was modifiedtests/pySim-shell_test/utils.py
Commit b845aab4733f6f89a6e396dca125dac6aa7a39e5 by pmaier@sysmocom.de
docs/osmo-smdpp: fix markup

Change-Id: I4a0ed6fb2eedf1892835c43d304a53c995f028c8
The file was modifieddocs/osmo-smdpp.rst
Commit 3ef2c40951d61d491baccef58e0ff63631a62c89 by pmaier@sysmocom.de
docs/osmo-smdpp: fix typo

Change-Id: I9978c5e02c1affe95a3b72d63e88965d7af5303e
The file was modifieddocs/osmo-smdpp.rst
Commit 4aaccf8751be15e4969bea1f680993cc1f1e4933 by pmaier@sysmocom.de
docs/legacy: remove unused '::' paragraph.

Change-Id: If51564665d3793d9108053ffeb97d81ae93ced51
The file was modifieddocs/legacy.rst
Commit 90881a2fff739e1d6ade9924730d8eff93026f39 by pmaier@sysmocom.de
docs/osmo-smdpp: restructure subsection "osmo-smdpp"

Sphinx is complaining about a duplicate label "osmo-smdpp". Apparantly
because we use this label twices as section headline. The subsection
"osmo-smdpp" in "Running osmo-smdpp" talks about the commandline and the
supplementary files that osmo-smdpp needs to run. Let's split the two
topics into two different sections.

Change-Id: I8bc4979160a00d36a03b9cd10679562a08c2c55c
The file was modifieddocs/osmo-smdpp.rst
Commit f951c56449bdf49152bca7cf4b8ca6c21637ea16 by pmaier@sysmocom.de
global_platform/scp: refactor _wrap_cmd_apdu

The _wrap_cmd_apdu methods for SCP02 and SCP03 are a bit hard to read. Let's
refactor them so that it is easier to understand what happens. In particular
that one can not have encryption (cenc) without signing (cmac)

Related: OS#6367
Change-Id: I4c5650337779a4bd1f98673650c6c3cb526d518b
The file was modifiedpySim/global_platform/scp.py
Commit 852eff54df65b076c4db11a2220cff678ab416f8 by pmaier@sysmocom.de
pySim/transport add support for T=1 protocol and fix APDU/TPDU layer conflicts

ETSI TS 102 221, section 7.3 specifies that UICCs (and eUICCs) may support two
different transport protocols: T=0 or T=1 or both. The spec also says that the
terminal must support both protocols.

This patch adds the necessary functionality to support the T=1 protocol
alongside the T=0 protocol. However, this also means that we have to sharpen
the lines between APDUs and TPDUs.

As this patch also touches the low level interface to readers it was also
manually tested with a classic serial reader. Calypso and AT command readers
were not tested.

Change-Id: I8b56d7804a2b4c392f43f8540e0b6e70001a8970
Related: OS#6367
The file was addedtests/pySim-shell_test/apdu/__init__.py
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim/transport/calypso.py
The file was modifiedtests/unittests/test_globalplatform.py
The file was modifiedpySim/global_platform/scp.py
The file was modifiedtests/unittests/test_utils.py
The file was modifiedpySim-trace.py
The file was modifiedpySim-shell.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_scp02.template
The file was addedtests/pySim-shell_test/apdu/test_apdu_legacy_scp02.template
The file was addedtests/pySim-shell_test/apdu/test.py
The file was modifiedpySim/utils.py
The file was modifiedpySim/commands.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/global_platform/__init__.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_legacy_scp03.template
The file was modifiedpySim/euicc.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_legacy.script
The file was modifiedtests/pySim-shell_test/lchan/test.ok
The file was modifiedtests/pySim-shell_test/config.yaml
The file was modifiedpySim-read.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_scp03.template
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/pcsc.py
The file was addedtests/pySim-shell_test/apdu/test_apdu.script
Commit 385d4407da37ae2ebc0022478f2b988004d0db48 by pmaier@sysmocom.de
pySim-shell_test: add new testcase for card initialization

The card initialization normally takes place automatically. Nearly all
testcases implicitly cover this code-path. However, it is also possible
to skip the card initialization and do it at some later point. This is
commonly the case for unprovisioned card that require some custom APDUs
in a basic initialization step. When this step is done one would use
the "equip" command to level up to the full featured mode. This patch
adds a testcase for this scenario

Related: OS#6367
Change-Id: I01a03fa07d8c62164453bd707c5943288ff1a972
The file was addedtests/pySim-shell_test/card_init/__init__.py
The file was addedtests/pySim-shell_test/card_init/test.py
The file was addedtests/pySim-shell_test/card_init/test_card_init.script
Commit de8cc322f1734497dd7fa34421219e486adb13b9 by pmaier@sysmocom.de
docs: add topic about remote UICC/eUICC access

With osmo-remsim and Android APDU proxy we have two powerful solutions to
allow remote acces to UICC/eUICC cards. Let's add a section where we give
a brief overview about those solutions, so that pySim-shell users get
awre of them.

Related: OS#6367
Change-Id: I73de4de2e5d4a01d6d91989ee684cbdb680de8ef
The file was modifieddocs/shell.rst
The file was addeddocs/remote-access.rst
Commit 599845394ed48f8101bb25bf1c99ec5945049256 by laforge
esim.saip: Fix parsing/generating fillPattern + repeatPattern

So far we only thought of default filling coming from a template.
However, filling can happen from the Fcp, and we need to properly parse
and [re-]encode that information.

Change-Id: Iff339cbe841112a01c9c617f43b0e69df2521b51
Related: OS#6643
The file was modifiedpySim/esim/saip/__init__.py
Commit 118624d256f914553dae307e1ca760d3c5758687 by laforge
pySim.esim.saip: Treat "Readable and Updateable when deactivated" flag

There's a second flag hidden in the TS 102 222 "Special File
Information"; let's parse + re-encode it properly.

Change-Id: I7644d265f746c662b64f7156b3be08a01e3a97aa
Related: OS#6643
The file was modifiedpySim/esim/saip/__init__.py
Commit 6046102cbbc22d33dbaa29572a4d2d084013ebb9 by laforge
esim.saip: Compute number of records from efFileSize and record_len

If we know the efFileSize and record_len, but Fcp doesn't contain
the number of records, we can simply compute it.

Change-Id: I0cc8e7241e37ee23df00c2622422904e7ccdca77
The file was modifiedpySim/esim/saip/__init__.py
Commit 779092b0cd46b493faa6a40d2ecfb9d1df659750 by laforge
esim.saip: Fix computation of file content

When generating the file content (body), we need to proceed in the
following order:

1a) If FCP contains fillPattern/repeatPattern, compute file content from those

1b) If FCP doesn't contain fillPattern/repeatPattern but template
    exists, compute file content from template

2)  Apply any fillFileConten / fillFileOffset from the SAIP File on top
    of the above

Change-Id: I822bb5fbec11a3be35910a496af7168458fd949c
Closes: OS#6642
The file was modifiedpySim/ts_102_222.py
The file was modifiedpySim/esim/saip/__init__.py
Commit 93237f4407fc80e63ec1f6fafbfe374028a1b777 by laforge
[cosmetic] esim.saip: Fix various typos in comments/docs/messages

Change-Id: I4fc603634a0f2b53e432a77f05e811a38ba065c2
The file was modifiedpySim/esim/saip/__init__.py
Commit 5354fc22d0ff03672727916587836fa007c15aee by laforge
[cosmetic] esim: Fix various typos in comments/messages/docs

Change-Id: I806c7a37951e72027ab9346169a3f8fe241f2c46
The file was modifiedpySim/esim/bsp.py
The file was modifiedpySim/esim/x509_cert.py
The file was modifiedpySim/esim/http_json_api.py
The file was modifiedpySim/esim/saip/personalization.py
Commit 34423337608c56db3c83cda0b0c372e38aa1c01e by laforge
esim.saip: New methods for inserting ProfileElement into sequence

ProfileElements.insert_after_pe() is a convenience method to insert
a new PE after an existing one in the sequence.  This is a frequent
task as there are strict ordering requirements in the SAIP format.

Change-Id: I4424926127b4867931c2157e9340bacd2682ff0c
The file was modifiedpySim/esim/saip/__init__.py
Commit 0516e4c47ae07ad35dfad5eb5aed1fd26f43602b by laforge
esim.saip.File: Re-compute file_size when changing body

If the API user modifies the size of the body, we need to check if we
need to re-compute the file_size attribute which is later encoded into
the fileDescriptor.  The size obviously must be large enough to fit the
body.  Let's do this implicitly by introducing a setter for File.body

Change-Id: I1a908504b845b7c90f31294faf2a6e988bdd8049
The file was modifiedpySim/esim/saip/__init__.py
Commit 0f1ffd20efe9a3b34ed5288bd725ec83beeac555 by laforge
esim.saip.File: Proper ARR conversion of template (into) to file (bytes)

The encoding of the access rule reference is different in FileTemplate
vs File, let's make sure we properly convert it when instantiating a
File from a FileTemplate.

Change-Id: Ibb8afb85cc0006bc5c59230ebf28b2c0c1a8a8ed
The file was modifiedpySim/esim/saip/__init__.py
Commit 9ac4ff3229edb34e9956f4da84ece64a4a5d70ba by laforge
esim.saip.File: Suppress encoding attributes that are like template

The point of the SAIP template mechanism is to reduce the size of the
encoded profile.  Therefore, our encoder in the to_fileDescriptor()
method should suppress generating attributes if their value is identical
to that of the template (if any).

Change-Id: I337ee6c7e882ec711bece17b7a0def9da36b0ad7
The file was modifiedpySim/esim/saip/__init__.py
Commit 9d7caef810813ad4d747e71f6e85f75d5a06bfe0 by laforge
esim.saip.FsProfileElement: Add create_file() method

So far we mainly created File() instances when parsing existing
profiles.  However, sometimes we want to programmatically create Files
and we should offer a convenience helper to do so, rather than asking
API users to worry about low-level details.

Change-Id: I0817819af40f3d0dc0c3d2b91039c5748dd31ee2
The file was modifiedpySim/esim/saip/__init__.py
Commit 0bb8b44ea828de58dfb25ec6325197b3b46654d4 by laforge
esim.saip.ProfileElementUSIM: Fix IMSI decode if [only] template based

In case the fileDescriptor of EF.IMSI is purely template based and only
the file content is given in the actual profile, we must pass a template
reference to the File() constructor before we can read the IMSI.

This fixes the following exception for some profiles:
ValueError: File(ef-imsi): No fileDescriptor found in tuple, and none set by template before

Change-Id: I14157a7b62ccd9b5b42de9b8060f2ebc5f91ebb3
The file was modifiedpySim/esim/saip/__init__.py
Commit d1ddb1e3520bc56428beded8a3cdaab7b6b1bdc2 by laforge
docs: Add documentation about contrib/sim-rest-{server,client}

Those programs have been around since 2021 but we never had any
documentation here. Let's fix that.

Change-Id: I7c471cac9500db063a0c8f5c5eb7b6861b3234ed
The file was addeddocs/sim-rest.rst
The file was modifieddocs/index.rst
Commit 73c76e02ce65008522dfe0fccd27441fa1361b91 by laforge
contrib/esim-qrcode.py: Small command line tool to encode eSIM QR codes

Change-Id: I7983de79937124cc258efd459c51f812f5fa79cb
The file was addedcontrib/esim-qrcode-gen.py
Commit 1be2e9b7132c529f73b23d78a9b2aba262bb17b8 by laforge
contrib/suci-keytool.py: Convenience tool for SUCI key generation

This adds a small utility program that can be used for generating
keys used for SUCI in 5G SA networks, as well as for dumping them
in a format that's compatible with what is needed on the USIM.

Change-Id: I9e92bbba7f700e160ea9c58da5f23fa4c31d40c6
The file was addedcontrib/suci-keytool.py
The file was modifieddocs/index.rst
The file was addeddocs/suci-keytool.rst
Commit 708a45bcee7154738aa8519b18833ad6b5a2fa46 by laforge
es2p_client: Print the activation code after confirmOrder success

Change-Id: I92608ff0cdc35b184edff0c656221644ba36f257
The file was modifiedcontrib/es2p_client.py
Commit 2debf5dc4be459ae12e173906e01ca033a5ea79c by laforge
docs/shell: Fix documentation for eUICC ISD-R specific commands

Back in January 2024 in change 7ba09f9392c8023842a7b5576936cb21ff85c6c0
we migrate dthe commands from 'class ADF_ISDR' to CardApplicationISDR
without updating the sphinx-argparse references in the documentation.

Let's fix that, making the syntax reference for those commands re-appear
in the documentation.

Change-Id: I1d7e2d1a5dfbdcc11b1fdb3e89845787f7cddbfc
The file was modifieddocs/shell.rst
Commit ceed99ad3c1ba511f8a07a017863653756e7275d by jean-pierre.marcotte.1
Fixing 3-digit MNC PLMN Encoding/Decoding tests expected values for EF_OPL and EF_ePDGSelection.

Related: pyosmocom.git I3811b227d629bd4e051a480c9622967e31f8a376
Change-Id: Ib2b586cb570dbe74a617c45c0fca276b08bb075e
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/ts_31_102.py
Commit 45d1b4339399d617e12a05522cb214a7bbbb8508 by pmaier@sysmocom.de
ts_31_102: fix testcase for EF_ePDGSelection

the testcase EF_ePDGSelection has a wrong testvector in the plmn field.
This test vector is accepted because there is a complementary error in
pyosmocom. However, the root problem got fixed (see depends), which means
that the test vector of EF_ePDGSelection now needs to be updated.

Depends: pyosmocom.git: I3811b227d629bd4e051a480c9622967e31f8a376
Change-Id: I96fd4c13c8e58ef33ddf9e3124617b1b59b9b2c1
Related: OS#6598
The file was modifiedpySim/ts_31_102.py
Commit 9f9e931378e00a3395af0cf8a4ae7f6992b15e37 by pmaier@sysmocom.de
pySim-shell: reset card in method equip

When the equip method is running, all kinds of states in pySim-shell are reset.
To be sure that the card state is also reset (normally this is the case because
usually init_card is called before equip), we should send an explicit reset to
the card as well.

Related: OS#6640
Change-Id: I622a2df2c9184841f72abd18483bfbfd00b2f464
The file was modifiedpySim-shell.py
Commit 67c0fff15b0da7a00f5bd1cdb0eaa2a1c01359f3 by pmaier@sysmocom.de
pySim-shell: change Prompt character to "#" after "verify_adm"

Let's change the prompt from ">" to "#" when the user gains admin
privilegs using verify_adm.

Related: OS#6640
Change-Id: I957b9df7b5069b6fce5bf958c94e8ffda833c77f
The file was modifiedpySim-shell.py
The file was modifiedpySim/runtime.py
Commit 16920aeacd467b80e39a3dd90520de69754fc005 by laforge
README.md update / re-wording

Let's give a better description of what the project is all about, and
differentiate reading/exploring any SIM from writing/updating a special
programmable one where you know the ADM credentials.

Change-Id: Ied2a9626594e9735d92d4eabe6c6b90f92aa2909
The file was modifiedREADME.md
Commit 8711bd89b0a3230375c1e77e044bf2772fb02bf6 by pmaier@sysmocom.de
ara_m: fix spec reference.

there are multiple references to a specification "SEID". As it seems this is
a reference to the GlobalPlatform "Secure Element Access Control" spec, which
has the document reference "GPD_SPE_013". Let's use "GPD_SPE_013" to referene
the spec.

Related: SYS#6681
Change-Id: I77895f1b84126563380ce89aa07a3b448d8784a3
The file was modifiedpySim/ara_m.py
Commit 25319c5184dcabe31a57685e487a541300ebca41 by pmaier@sysmocom.de
ara_m fix export of AID-REF-DO (empty)

GPD_SPE_013 Table 6-3 defines two types of AID-REF-DO objects (both
are fully independed TLV IEs with the same name). The version with
tag '4F' identifies an SE application. It may contain an AID prefix
or even be of length 0 in case the rule should apply to all SE
applications. Then there is the version with tag 'C0', which must
always have length 0 and serves a flag to apply the rule to the
implicitly selected SE application. Technically both are completely
different things, so we must also treat them separately in the
pySim-shell code.

Related: OS#6681
Change-Id: I771d5e860b12215280e3d0a8c314ce843fe0d6a2
The file was modifiedpySim/ara_m.py
The file was modifiedtests/pySim-shell_test/ara_m/adf_ara-m.script.ok
The file was modifiedtests/pySim-shell_test/ara_m/test.script
The file was modifiedtests/pySim-shell_test/ara_m/adf_ara-m.cfg.ok
Commit 9df5e2f17152d17594560e9b9b0754d36cfeb2e3 by pmaier@sysmocom.de
javacard, cosmetic: fix sourcecode fromatting and improve docstring

The line with TAGS is longer than 120 columns and there is some
comment that should be moved to the python docstring.

Related: OS#6679
Change-Id: I1d02098320cfbe17a0eb1bfdcf3bc85034cc8e20
The file was modifiedpySim/javacard.py
Commit 6287db48552634117f1560ad110cac2a4898019e by pmaier@sysmocom.de
global_platform: remove unused code

This commented out part is not needed anymore.

Related: OS#6679
Change-Id: If1de0218f841159789ac86f6a13740c1cbd0a57a
The file was modifiedpySim/global_platform/__init__.py
Commit 2a833b480a644a33a3a322dd5a87a22f4ff2f828 by pmaier@sysmocom.de
global_platform: fix command "delete"

The delete command formats a TPDU, not APDU, which leads to warning messages

Related: OS#6679
Change-Id: Id04c89acbd4f449cb974d3cb05024f11dba4684e
The file was modifiedpySim/global_platform/__init__.py
Commit 6d2e3853b4120cbb0f8589cd0a84c399b28fcd38 by pmaier@sysmocom.de
global_platform: add spec reference to help of --install-parameters

Related: OS#6679
Change-Id: I7e8174d469e09ad130d2866663a65bdeb4afc35a
The file was modifiedpySim/global_platform/__init__.py
Commit 712946eddb9eedce30b44276d7bd75f40c9a69b9 by pmaier@sysmocom.de
javacard: add parser for JAVA-card CAP file format

To install JAVA-card applets we need to be able to extract the executeable
loadfile and the AIDs of the applet and the loadfile. This patch adds the
parser and related unittests.

Related: OS#6679
Change-Id: I581483ccb9d8a254fcecc995fec3c811c5cf38eb
The file was addedtests/unittests/test_javacard.cap
The file was addedtests/unittests/test_javacard.py
The file was modifiedpySim/javacard.py
Commit 14d6e68ff796320a76bcf5a66559891c0b8202be by laforge
cards: Avoid exception seen with (some) GSM-R SIM cards

Some old cards are classic SIM and not based on UICCs.  Such cards
do not offer the capability of selecting applications.  Let's avoid
running into an exception by providing dummy methods that simply fail
for each AID selection.

Change-Id: Ib3457496380c0c5096052ad7799970ee620dee33
Closes: OS#6691
The file was modifiedpySim/cards.py
Commit f688d28107aadf24b18694df96307457816db142 by pmaier@sysmocom.de
global_platform: fix usage of the Key Version Number (kvn)

The kvn parameter is used to select a keyset when establishin a secure channel.
At the moment this is a mandatory parameter and it must be within a certain
range.

However GPC_SPE_034 explicitly defines a reserved kvn value 0, that always
refers to the first available key. That effectively makes it an optional
parameter and the commandline interface should have the --key-ver parameter
as an optional parameter.

The ranges also have to be extended to allow 0 as kvn value. We also have to
put a range to support the sysmoUSIM-SJS1, which uses kvn value 1, which is
a non standard value.

Related: OS#6679
Change-Id: I42be2438c7f199b238f2ec7a9434cec5393210a7
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/global_platform/scp.py
Commit a0071b32ffac2239d6a653e85afb813092aedb88 by pmaier@sysmocom.de
global_platform: LOAD and INSTALL [for load] support

In this patch we add the commands "install_for_load" and "load".

Depends: pyosmocom.git I86df064fa41db85923eeb0d83cc399504fdd4488
Change-Id: I924aaeecbb3a72bdb65eefbff6135e4e9570579e
Related: OS#6679
The file was modifiedsetup.py
The file was modifiedrequirements.txt
The file was modifieddocs/shell.rst
The file was modifiedpySim/global_platform/__init__.py
Commit 15140aae444378b55fb683d4477162bbef79ff43 by pmaier@sysmocom.de
global_platform: add new command "install_cap"

Installing JAVA-card applets from a CAP file is a multi step process, which is
difficult when done manually. Fortunately it is easy to automate the process,
so let's add a dedicated command for that.

Change-Id: I6cbd37f0fad5579b20e83c27349bd5acc129e6d0
Related: OS#6679
The file was addeddocs/cap-tutorial.rst
The file was modifieddocs/shell.rst
The file was addedpySim/global_platform/install_param.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedtests/unittests/test_globalplatform.py
Commit d871e4696f70e747bc4a6a04f35fd0b0141ceb5b by pmaier@sysmocom.de
ATR: use lowercase hex strings without spaces as ATR constants

The ATR constants are the only hex string constants where the hex
bytes digits are separated with spaces. Also the hex digits are in
lowercase. Let's use a lowercase string without spaces here like
we do in many other code locations.

Related: OS#6322
Change-Id: I95118115b02523ed262a2fbe4369ace3996cd8f5
The file was modifiedpySim/sysmocom_sja2.py
The file was modifiedpySim/legacy/cards.py
Commit 08ba187fd446db422a2bebbd4a9b2564096cace2 by pmaier@sysmocom.de
ATR: align get_atr() return value type

type annotations claimed the return type was Hexstr, but in reality
it was a list of integers.  Let's fix that.

Change-Id: I01b247dad40ec986cf199302f8e92d16848bd499
Closes: OS#6322
The file was modifiedpySim/legacy/cards.py
The file was modifiedpySim/runtime.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/transport/pcsc.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/transport/serial.py
Commit edcd62435d0777ad798e44b4613eff8332030d14 by pmaier@sysmocom.de
pySim/transport: add abstract get_atr method to LinkBase

The implementations that inheret from the LinkBase class are expected to
implement a get_atr method. This method is mandatory, since it is one of
the most basic functionalities of pySim to display an ATR. Also the ATR
is sometimes needed to distinguish between different card models.

The modem_atcmd and calypso implementation completely lack the get_atr
method. Apparantly it is not possible to get an ATR in those
environments, so lets add a dummy method there.

Related: OS#6322
Change-Id: I4fc020ca45658af78e495a5c1b985213f83cbb50
The file was modifiedpySim/transport/modem_atcmd.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/calypso.py
Commit 8a61498ba6b0a497be82a33f5b26482f5b3159f9 by nhofmeyr
.gitignore: dist subdir, may be created by pip

Change-Id: Ib23a687845842bd25d83f87aa00ae0c278abc842
The file was modified.gitignore
Commit 30e40ae520d9c133448541aa93d3c51d675d4a7e by nhofmeyr
setup.py: install esim.asn1 resources, install esim.saip

These changes are necessary to successfully run
./tests/unittests/test_esim_saip.py with a pySim installed via
'pip install'.

For example:

   virtualenv venv
   source venv/bin/activate
   git clone ssh://gerrit.osmocom.org:29418/pysim
   pip install pysim/
   cd pysim
   ./tests/unittests/test_esim_saip.py

Before this patch, that would result first in package pySim.esim.saip
being unknown (not installed at all), and when that is added to
setup.py, in this error:

Traceback (most recent call last):
  File "/home/moi/osmo-dev/src/pysim/tests/unittests/./test_esim_saip.py", line 23, in <module>
    from pySim.esim.saip import *
  File "/home/moi/s/esim/sysmo_esim_mgr/venv/lib/python3.13/site-packages/pySim/esim/saip/__init__.py", line 41, in <module>
    asn1 = compile_asn1_subdir('saip')
  File "/home/moi/s/esim/sysmo_esim_mgr/venv/lib/python3.13/site-packages/pySim/esim/__init__.py", line 56, in compile_asn1_subdir
    for i in resources.files('pySim.esim').joinpath('asn1').joinpath(subdir_name).iterdir():
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/pathlib/_local.py", line 577, in iterdir
    with os.scandir(root_dir) as scandir_it:
~~~~~~~~~~^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/moi/s/esim/sysmo_esim_mgr/venv/lib/python3.13/site-packages/pySim/esim/asn1/saip'

After this patch, the test completes successfully.

......
----------------------------------------------------------------------
Ran 6 tests in 0.067s

OK

Related: sysmocom's eSIM manager product that is currently in
development needs to fully use pySim.esim.saip, ideally from a regular
'pip install', and not from using the pySim source tree directly.

Related: SYS#6768
Change-Id: I0d7d6962a308eccca589a42c22546d508ff686f5
The file was modifiedsetup.py
Commit de91b0dc976e9de131974e014ce309a359c5d5b3 by laforge
euicc: Add euicc_memory_reset shell command

This implements the ES10c eUICC Memory Reset procedure

Change-Id: Ib462f5b7de3e500e51c0f3d6e2b9b0c2d3ba7e20
The file was modifiedpySim/euicc.py
The file was modifieddocs/shell.rst
Commit c4a6b8b3e794dce6dd6b79b9fdbc76d93a48c122 by pmaier@sysmocom.de
pySim-shell: obey quit command in startup commands+scripts

Startup scripts are executed using the cmd2 provided onecmd_plus_hooks
method. This method can run arbitrary commands, which also includes
the command "run_scrit" that we use to execute startup scripts.

When a script executes a quit command, or when someone issues a quit
command using the --execute-command or the command argument, then
this commands is executed. However a quit command won't actually quit
the process. All it does is to change the return code of
app.onecmd_plus_hooks (see [1]). So we must evaluate the return code
and take care of the quitting ourselves.

[1] https://cmd2.readthedocs.io/en/0.9.15/api/cmd.html#cmd2.cmd2.Cmd.onecmd_plus_hooks

Related: OS#6731
Change-Id: Ic6e9c54cdb6955d65011af3eb5a025eee5da4143
The file was modifiedpySim-shell.py
Commit 80a5dd1cf6bae63b83005d0f99664dbe7a23701c by Neels Hofmeyr
docs/osmo-smdpp.rst: fix typo apostrophe

Change-Id: I32b18a61301fc2784675fa8acbeadb996ebcd821
The file was modifieddocs/osmo-smdpp.rst
Commit 1d962ec8c8cfe235ad1aafe6e67081bf3f86649d by Neels Hofmeyr
osmo-smdpp.py: enable --host and --port cmdline args (and document)

Change-Id: Ic98dac1e1e713d74c3f8052c5bbeb44445aa8ab4
The file was modifiedosmo-smdpp.py
The file was modifieddocs/osmo-smdpp.rst
Commit 15df7cbf884f5db55c274a0951b577ce071ec7c2 by Neels Hofmeyr
add PEM cert as used in docs/osmo-smdpp.rst

Add PEM version of smdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.der

A CERT_S_SM_DP_TLS_NIST.pem file is referenced in docs/osmo-smdpp.rst --
nginx apparently cannot use DER certs, so it is convenient for beginners
if the example from the docs just works without having to know that:

The added file was produced using

    openssl x509 -inform DER -in CERT_S_SM_DP_TLS_NIST.der -outform PEM -out CERT_S_SM_DP_TLS_NIST.pem

Change-Id: I41ba6ebacb71df0eb8a248c0c3c9ccd709718d74
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.pem
Commit 9e8143723dfa63d8d4a2a1db8a59c84b7bfdf95c by Neels Hofmeyr
.gitignore tags (from ctags)

Change-Id: I1ae374e687b885399e0abfa39fcd750d944ae7ce
The file was modified.gitignore
Commit e91488d21fff96b5b23670aa9f6a0583807f8a57 by Neels Hofmeyr
.gitignore: smdpp-data/sm-dp-sessions from running osmo-smdpp.py

Change-Id: I02a4ad4bc8e612e64111b16bc11c8c3d4dd41c45
The file was modified.gitignore
Commit 19e1330ce8856cc6e0e28aeed1da20dc0fe4efa8 by Neels Hofmeyr
pylint: personalization.py: fix E1135: permitted_len unsupported-membership-test

pre-empt this from coming up in patch
I60ea8fd11fb438ec90ddb08b17b658cbb789c051:

E1135: Value 'self.permitted_len' doesn't support membership test (unsupported-membership-test) pickermitted_len

Change-Id: I0343f8dbbffefb4237a1cb4dd40b576f16111073
The file was modifiedpySim/esim/saip/personalization.py
Commit cabb8edd53a0676902176f904e53ba7bb608f03b by Neels Hofmeyr
pylint: ota.py: fix E0606 possibly-used-before-assignment

************* Module pySim.ota
pySim/ota.py:430:24: E0606: Possibly using variable 'cpl' before assignment (possibly-used-before-assignment)

Change-Id: Ibbae851e458bbe7426a788b0784d553753c1056f
The file was modifiedpySim/ota.py
Commit 74be2e202fd8c503eb00a870519fdf5c14b39fb7 by laforge
filesystem: do not decode short TransRecEF records

A TransRecEF is based on a TransparentEF. This means that a TransRecEF
is basically normal TransparentEF that holds a record oriented data
structure. This also requires that the total length of the TransRecEF
is a multiple of the record length of the data structure that is stored
in it. When this is not the case, the last record will be cut short and
the decoding will fail. We should guard against this case.

Related: OS#6598
Change-Id: Ib1dc4d7ce306f1f0b080bb4b6abc36e72431d3fa
The file was modifiedpySim/filesystem.py
Commit 8da8b20f58f2fedbc0412a6741b12dbb2772cada by laforge
es8p: fix typo

Change-Id: I241efe0c7ceab190b7729a6d88101501ca37652e
The file was modifiedpySim/esim/es8p.py
Commit f57f6a95a5fae4246c0a65bf92ced951e803df07 by laforge
pySim/commands: Fix envelope command APDU case after T=1 support

When we merged I8b56d7804a2b4c392f43f8540e0b6e70001a8970 for T=1
support, the ENVELOPE C-APDU was not adjusted to reflect the correct
case.  ENVELOPE expects a response and hence needs a Le byte present.

This avoids below related message when performing e.g. OTA via SMS

  Warning: received unexpected response data, incorrect APDU-case (3, should be 4, missing Le field?)!

Change-Id: Ice12675e02aa5438cf9f069f8fcc296c64aabc5a
Related: OS#6367
The file was modifiedpySim/commands.py
Commit 701e011e14f9353af2648f11f136127f5ff1ce12 by laforge
[cosmetic] pySim.transport: Fix spelling/typos in comment

Change-Id: Ia20cc2439bf00c1b6479f36c05514945ac4faf71
The file was modifiedpySim/transport/__init__.py
Commit 02a7a2139fb23c7a6beb6728fefdd21fd7034da9 by pmaier@sysmocom.de
saip-tool: add function to write PE sequence

To prevent code duplication and to make the implementation simpler,
let's add a function that takes care of writing the PE sequnece
to an output file.

Change-Id: I38733422270f5b9c18187b7f247b84bf21f9121b
The file was modifiedcontrib/saip-tool.py
Commit 2b3b2c2a3be1f30bbd9fab8f5fc24675411c5e9c by pmaier@sysmocom.de
saip-tool: add option to extact profile elements to file

In some cases it may be helpful to extract a single profile element
from the sequence to a dedicated file.

Change-Id: I77a80bfaf8970660a84fa61f7e08f404ffc4c2da
The file was modifiedcontrib/saip-tool.py
Commit dc2b9574c95c6f59f7bb2ede7c11cbc3c781399c by pmaier@sysmocom.de
saip-tool: allow removing of profile elements by type

At the moment it is only possible to remove profile elements by their identification
number. However, there may be cases where we want to remove all profile elements of
a certain type at once (e.g. when removing all applications).

Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
The file was modifiedcontrib/saip-tool.py
Commit 40e795a82523ab31a92965423497240f56968cc1 by pmaier@sysmocom.de
saip-tool: add ProfileElement class for application PE

The application profile element has no ProfileElement class yet, so
let's create a ProfileElementApplication class and move the existing
extract-apps code into a method of ProfileElementApplication.

Change-Id: Iaa43036d388fbf1714c53cab1fc21092c4667a21
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedcontrib/saip-tool.py
Commit a2bfd397badd6bddff66d0a59a96e13cf4f4c9e1 by laforge
pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing

The pySim-smpp2sim.py program exposes two interfaces:
* SMPP server-side port, so external programs can rx/tx SMS
* APDU interface towards the SIM card

It therefore emulates the SMSC, Core Network, RAND and UE parts
that would normally be encountered in an OTA setup.

Change-Id: Ie5bae9d823bca6f6c658bd455303f63bace2258c
The file was modifieddocs/index.rst
The file was addedpySim-smpp2sim.py
The file was addeddocs/smpp2sim.rst
The file was modifiedrequirements.txt
The file was modifiedpySim/sms.py
The file was modifiedpySim/cat.py
The file was modifiedsetup.py
Commit 1dea0f39dcf5abf15fd65bba824a7cf8fe1581d9 by laforge
saip-tool: add features to add, remove and inspect application PEs

The PE-Application object is used to provision JAVA-card applications
into an eUICC during profile installation. Let's extend the SAIP-tool
so that we are able to add, remove and inspect applications.

Change-Id: I41db96f2f0ccc29c1725a92215ce6b17d87b76ce
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedcontrib/saip-tool.py
The file was addedcontrib/saip-tool_example_add-app.sh
The file was addeddocs/saip-tool.rst
The file was addedcontrib/saip-tool_example_extract-apps.sh
The file was addedcontrib/saip-tool_example_remove-app-inst.sh
The file was addedcontrib/saip-tool_example_remove-app.sh
The file was modifieddocs/index.rst
Commit 59faa02f9a746471bb8457788b1d6ffb02c3275c by laforge
ara_m: add command to lock write access to the ARA-M rules.

Recent versions of the ARA-M applet from Bertrand Martel can lock
the write access to ARA-M rules. Let's add a command for that and
some documentation.

Related: SYS#7245
Change-Id: I71581a0c9f146f9a0921093d9b53b053b4a8946c
The file was modifieddocs/shell.rst
The file was modifiedpySim/ara_m.py
Commit d5da431fd457244d39446ca435898aac415534a7 by pmaier@sysmocom.de
saip-tool: add commandline option to edit mandatory services list

Change-Id: I120b98d4b0942c26674bc1365c5711101ec95235
The file was modifiedcontrib/saip-tool.py
The file was modifiedpySim/esim/saip/__init__.py
Commit 08e6336fc925215f18660f947839c99d6438a9a4 by Vadim Yanitskiy
doc/card-key-provider: fix WARNING: Title underline too short

Change-Id: I29fda8350de75c4e7c0020fa4dce4cd0e5defda7
The file was modifieddocs/card-key-provider.rst
Commit aace546900e810d25dac113e42bd428d2d09b506 by Vadim Yanitskiy
filesystem: fix WARNING: Block quote ends without a blank line

Use the 'r' (raw) qualifier to avoid rendering '\n' as the actual
line break in the auto-generated documentation.

Change-Id: Ie7f59685a78534eb2c43ec4bc39685d3fd264778
The file was modifiedpySim/filesystem.py
Commit fbe6d02ce36c0d42fb970f6d17fc6b0e02ac375e by Vadim Yanitskiy
docs/saip-tool: fix ERROR: Unexpected indentation

According to [1], the literal block must be indented (and, like all
paragraphs, separated from the surrounding ones by blank lines).

[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#literal-blocks

While at it, fix tabs-vs-spaces: use 2 spaces like in other places.

Change-Id: If548bf66339433c1f3f9e2a557821e808c6afa26
The file was modifieddocs/saip-tool.rst
Commit d838a95c2a60d63d49111083591fbe6c8c179b17 by laforge
edit_{binary,record}_decoded: Support hex-decode of bytes

We've created + used osmocom.utils.JsonEncoder as an encoder class
for json.{dump,dumps} for quite some time.  However, we missed to
use this decoder class from the edit_{binary,record}_decoded commands
in the pySim-shell VTY.

Change-Id: I158e028f9920d8085cd20ea022be2437c64ad700
Related: OS#6774
The file was modifiedpySim/filesystem.py
Commit 19f3759306abd1a835c79a77c0bd83490c3f9156 by laforge
osmo-smdpp: Renew SGP.26 TLS certificate for SM-DP+

The SGP.26 v3.0 certificate had expired on July 11, 2024. Let's replace
it with a cert of 10 year validity period to facilitate uninterrupted testing
with osmo-smdpp.

@@ -1,12 +1,12 @@
Certificate:
     Data:
         Version: 3 (0x2)
-        Serial Number: 9 (0x9)
+        Serial Number: 10 (0xa)
         Signature Algorithm: ecdsa-with-SHA256
         Issuer: CN=Test CI, OU=TESTCERT, O=RSPTEST, C=IT
         Validity
-            Not Before: Jun  9 19:04:42 2023 GMT
-            Not After : Jul 11 19:04:42 2024 GMT
+            Not Before: Apr 23 15:23:05 2025 GMT
+            Not After : Apr 21 15:23:05 2035 GMT
         Subject: O=ACME, CN=testsmdpplus1.example.com
         Subject Public Key Info:
             Public Key Algorithm: id-ecPublicKey

Change-Id: I6f67186b9b1b9cc81bfb0699a9d3984d08be8821
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.pem
Commit 949c2a2d579943f5286e1f4505be0835f149eab6 by laforge
Use osmocom.construct.{Bytes,GreedyBytes} for hexstring input support

The upstream construct.{Bytes,GreedyBytes} only support bytes/bytearray
input data for the encoder, while the [newly-created]
osmocom.construct.{Bytes,GreedyBytes} support alternatively hex-string input.

This is important in the context of encoding construct-based types from
JSON, where our osmocom.utils.JsonEncoder will automatically convert any
bytes to hex-string, while re-encoding those hex-strings will fail prior
to this patch.

Change-Id: I1c8df6350c68aa408ec96ff6cd1e405ceb1a4fbb
Closes: OS#6774
The file was modifiedpySim/global_platform/scp.py
The file was modifiedsetup.py
The file was modifiedpySim/sms.py
The file was modifiedpySim/ara_m.py
The file was modifiedpySim/ota.py
The file was modifiedpySim/ts_31_103_shared.py
The file was modifiedpySim/apdu/ts_31_102.py
The file was modifiedpySim/apdu/__init__.py
The file was modifiedrequirements.txt
The file was modifiedpySim/ts_31_103.py
The file was modifiedpySim/iso7816_4.py
The file was modifiedpySim/global_platform/http.py
The file was modifiedpySim/gsm_r.py
The file was modifiedpySim/cat.py
The file was modifiedpySim/sysmocom_sja2.py
Commit 004b06eab1d89ba2b29d7de9b7747cc2cdd0c8fd by Vadim Yanitskiy
jenkins.sh: workaround for 'usage: build.py' in docs

Recent versions of cmd2 have changed how the 'prog' attribute is
automatically set for ArgumentParser instances.  As a result, we
are now seeing an unexpected 'build.py' artifact appearing in
the generated documentation.

Let's use an older release of cmd2, which retains the old expected
behavior.  Use it specifically for building documentation.

Change-Id: Ifbad35adc5e9d3141acfd024d7dee2a25f1cb62e
Related: https://github.com/python-cmd2/cmd2/issues/1414
Related: OS#6776
The file was modifiedcontrib/jenkins.sh
Commit 89070a7c67abbf0b2a4b647eacfd2c59ed7b9671 by laforge
docs: Build the pySim.esim library documentation

... we added doc-strings but missed to actually render them in the
manual so far.

Change-Id: Iff2baca86376e68898a8af0252906f802ffa79eb
The file was modifieddocs/index.rst
The file was addeddocs/library-esim.rst
Commit e37cdbcd3e66d5ab833136e19b86ad36265ab593 by laforge
docs: Better python doc-strings for better pySim.esim manual

Change-Id: I7be6264c665a2a25105681bb5e72d0f6715bbef8
The file was modifiedpySim/esim/x509_cert.py
The file was modifiedpySim/esim/rsp.py
The file was modifiedpySim/esim/es8p.py
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedpySim/esim/__init__.py
The file was modifiedpySim/esim/saip/templates.py
The file was modifiedpySim/esim/saip/oid.py
The file was modifiedpySim/esim/saip/validation.py
The file was modifiedpySim/esim/bsp.py
The file was modifiedpySim/esim/saip/personalization.py
Commit c7c48718ba3637e29fc6a7af4e2e39ba0679bb8d by laforge
Get rid of [now] superfluous HexAdapter

With the introduction of using osmocom.construct.{Bytes,GreedyBytes}
in Change-Id I1c8df6350c68aa408ec96ff6cd1e405ceb1a4fbb we don't have a
need for wrapping each instance of Bytes or GreedyBytes into a
HexAdapter anymore.  The osmocom.construct.{Bytes,GreedyBytes} will
automatically perform the related hex-string-to-bytes conversion if
needed - and during printing we have osmocom.utils.JsonEncoder that
makes sure to convert any bytes type to a hex-string.

Change-Id: I9c77e420c314f5e74458628dc4e767eab6d97123
The file was modifiedpySim/ts_102_221.py
The file was modifiedpySim/global_platform/install_param.py
The file was modifiedpySim/euicc.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/cat.py
The file was modifiedpySim/sms.py
The file was modifiedpySim/cdma_ruim.py
The file was modifiedpySim/ts_31_103.py
The file was modifiedtests/unittests/test_utils.py
The file was modifiedpySim/gsm_r.py
The file was modifiedpySim/ts_102_310.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/ts_31_103_shared.py
The file was modifiedpySim/sysmocom_sja2.py
The file was modifiedpySim/ts_31_102.py
Commit 7fe7bff3d8e08bfd71f5884792765e7ca1047945 by ewild
smdpp: optional deps

Works locally, too:
$ pip install -e ".[smdpp]"

Change-Id: If69b2bd5f8bc604443108c942c17eba9c22f4053
The file was modifiedsetup.py
Commit 9572cbdb6132984c24dff1af0ca6bd5321b88380 by benispeter
smdpp: update certs

TLS will expire again:
$ find . -iname "CERT*NIST*der" | xargs -ti  openssl x509 -in {} -inform DER -noout -checkend $((24*3600*90))
...
openssl x509 -in ./smdpp-data/generated/DPtls/CERT_S_SM_DP_TLS_NIST.der -inform DER -noout -checkend 7776000
Certificate will expire
...

Grabbed from SGP.26_v1.5_Certificates_18_07_2024.zip available at
https://www.gsma.com/solutions-and-impact/technologies/esim/gsma_resources/sgp-26-test-certificate-definition-v1-5/

Change-Id: I25442d6f55a385019bba1e47ad3d795120f850ad
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP4_TLS.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP8_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2024/CERT_S_SM_DP2_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2024/CERT_S_SM_DP8_TLS.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.pem
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_BRP.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2024/CERT_S_SM_DP4_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2024/CERT_S_SM_DP_TLS_BRP.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP2_TLS.der
The file was addedsmdpp-data/certs/DPtls/Old_TLS_Validity/Expired 2024/CERT_S_SM_DP_TLS_NIST.der
Commit 5316f2b1cc9c2d3f04edc681b0dbc86dfb2d54bb by benispeter
smdpp: verify request headers

Change-Id: Ic1221bcb87a9975a013ab356266d3cb76d9241f1
The file was modifiedosmo-smdpp.py
Commit 5969901be524f30ae872ad60ad523b933ccb09ad by laforge
smdpp: Verify EID is within permitted range of EUM certificate

Change-Id: Ice704548cb62f14943927b5295007db13c807031
The file was modifiedosmo-smdpp.py
Commit 79805d1dd75b5da780e2be9491ebbfdf8481d58d by ewild
smdpp: reorder imports

Change-Id: Ib72089fb75d71f0d33c9ea17e5491dd52558f532
The file was modifiedosmo-smdpp.py
Commit ccefc98160303b149d8ef78ec55ecd04430a8384 by ewild
smdpp: add proper tls support, cert generation FOR TESTING

If TLS is enabled (default) it will automagically generate missing pem files + dh params.

A faithful reproduction of the certs found in SGP.26_v1.5_Certificates_18_07_2024.zip available at
https://www.gsma.com/solutions-and-impact/technologies/esim/gsma_resources/sgp-26-test-certificate-definition-v1-5/
can be generated by running contrib/generate_certs.py. This allows adjusting the expiry dates, CA flag,
and other parameters FOR TESTING. Certs can be used by the smdpp by running
$ python -u osmo-smdpp.py -c generated

Change-Id: I84b2666422b8ff565620f3827ef4d4d7635a21be
The file was addedsmdpp-data/sm-dp-sessions-BRP
The file was modified.gitignore
The file was addedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_BRP.pem
The file was addedcontrib/generate_smdpp_certs.py
The file was modifiedosmo-smdpp.py
The file was addedsmdpp-data/sm-dp-sessions-NIST
Commit 3c1a59640c6433d451bf29d22b9ca85e408b88be by ewild
smdp: clean up accidental commited trash

and update gitinore to ensure this does not happen again

Change-Id: Ieeb2da3bdb006b08e2f82bfc3b5252f4abf4420b
The file was modified.gitignore
The file was removedsmdpp-data/sm-dp-sessions-BRP
The file was removedsmdpp-data/sm-dp-sessions-NIST
Commit 0b1d3c85fd8cb249ac692a3b61879d622ac01815 by ewild
smdpp: less verbose by default

Those data blobs are huge.

Change-Id: I04a72b8f52417862d4dcba1f0743700dd942ef49
The file was modifiedpySim/esim/bsp.py
The file was modifiedosmo-smdpp.py
The file was modifiedpySim/esim/es8p.py
Commit 7798ea9c5c2091814ad59d2e77e179c453f88bcd by ewild
x509 cert: fix weird cert check

Change-Id: I18beab0e1b24579724704c4141a2c457b2d4cf99
The file was modifiedpySim/esim/x509_cert.py
Commit 70fedb5a46eabe969734bc4408e418577223e49a by ewild
smdpp: verify cert chain

Change-Id: I1e4e4b1b032dc6a8b7d15bd80d533a50fe0cff15
The file was modifiedosmo-smdpp.py
Commit cb7d5aa3a7f96370760fd94a39d8c0819cfe379d by ewild
smdpp: add proper brp cert support

Change-Id: I6906732f7d193a9c2234075f4a82df5e0ed46100
The file was modified.gitignore
The file was modifiedosmo-smdpp.py
Commit 6aed97d6c8945ec73f2fa4be0c375ec98c72866d by ewild
smdpp: fix asn1tool OBJECT IDENTIFIER decoding

While at it make the linter happy.
The feature to ignore blocks is making slow progress:
https://github.com/astral-sh/ruff/issues/3711#

Change-Id: Ic678e6c4a4c1a01de87a8dce26f4a5e452e8562a
The file was modifiedosmo-smdpp.py
Commit 6cffb31b427edc29862f2316b7d817aa4dddb6ba by ewild
memory backed ephermal session store for easy concurrent runs

Change-Id: I05bfd6ff471ccf1c8c2b5f2b748b9d4125ddd4f7
The file was modifiedpySim/esim/rsp.py
The file was modifiedosmo-smdpp.py
Commit b4a12ecc1402f7a0975d32abb87477fe8ab6a0ee by benispeter
smdp: update tls certs

Old expired today, new from https://www.gsma.com/solutions-and-impact/technologies/esim/wp-content/uploads/2021/07/SGP.26_v1.5-17-July-2025_files_v3.zip

Change-Id: I585efe3360a0aac2a49a79d5fef2789dea2b169d
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.pem
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP2_TLS.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_BRP.pem
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_BRP.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP_TLS_NIST.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP8_TLS.der
The file was modifiedsmdpp-data/certs/DPtls/CERT_S_SM_DP4_TLS.der
Commit 076fec267ae7d7ab40f05b8415a8bf8084184e16 by Oliver Smith
requirements: set cmd2>=2.6.2,<3.0

Remove the previous workaround that set cmd2==2.4.3 in jenkins.sh. The
bug this worked around has been fixed in 2.6.2.

3.0 will break unless we use some new additional decorator.

Related: OS#6776
Change-Id: I4ba65ed486247c5670313b75f43a242d264df14b
The file was modifiedrequirements.txt
The file was modifiedcontrib/jenkins.sh
Commit 10fe0e3aaeed857744819f487d1be7fbe270faf8 by Oliver Smith
docs: fix authors line exceeding the page

Fix that the authors get cut off as they exceed the page in the PDF
version. This can currently be seen here:
https://downloads.osmocom.org/docs/pysim/master/osmopysim-usermanual.pdf

Change-Id: Iacbba6c2f74bf2b9f96057e71bde017a11f703a8
The file was modifieddocs/conf.py
Commit 4dddcf932a28297963aab0ef15ba2fcc1485f3a2 by laforge
Make sure to select MF before probing for files/Addons

Change-Id: I685367c282f57a8856668a3172a9391a5bbcf2e2
The file was modifiedpySim/runtime.py
The file was modifiedpySim/cards.py
Commit caa955b3ac77d0cdb801a6ad143464dfd021d2cd by laforge
Identify cards by Historical bytes of ATR

- try to identify the CardModel by just comparing the Historical Bytes if matching by Whole ATR failed
- add decompose ATR code from pyscard-contrib

Related: OS#6837
Change-Id: Id7555e42290d232a0e0efc47e7d97575007d846f
The file was modifiedpySim/utils.py
The file was modifiedpySim/filesystem.py
Commit 92841f2cd5f65aec0dfa3ad7a7643605c54abf3a by laforge
docs/suci-keytool.rst: spelling fix

Change-Id: Idb45086d9d5963072fbc97835d551e2f78ad847f
The file was modifieddocs/suci-keytool.rst
Commit 5d2e2ee259b19e836a056bf8c8e7c9d33032f77f by laforge
bsp: fix maxpayloadsize

Change-Id: I08f544877b79681ad1f758a1ca31c292eae9f868
The file was modifiedpySim/esim/bsp.py
Commit 4ee99c18cd6c18ff6e8c71096a1f58901962acc8 by laforge
Fix typos

Found via `codespell -S tests -L ist,adn,ciph,ue,ot,readd,te,oce,tye`

Change-Id: I00a72e4f479dcef88f7d1058ce53edd0129d336a
The file was modifiedpySim/global_platform/uicc.py
The file was modifiedpySim/esim/es2p.py
The file was modifiedpySim/esim/http_json_api.py
The file was modifiedpySim/card_key_provider.py
The file was modifiedpySim/esim/saip/validation.py
The file was modifiedpySim/profile.py
The file was modifiedcontrib/es2p_client.py
The file was modifiedcontrib/saip-tool_example_add-app.sh
The file was modifieddocs/suci-tutorial.rst
The file was modifieddocs/sim-rest.rst
The file was modifiedpySim/ts_31_103_shared.py
The file was modifiedcontrib/es9p_client.py
The file was modifiedpySim/secure_channel.py
The file was modifiedpySim/ara_m.py
The file was modifiedpySim/ts_51_011.py
The file was modifiedpySim/cat.py
The file was modifiedpySim/esim/saip/__init__.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/utils.py
The file was modifiedpySim-read.py
The file was modifiedpySim/runtime.py
The file was modifiedpySim/ts_31_102.py
The file was modifiedcontrib/unber.py
The file was modifiedpySim-prog.py
The file was modifiedcontrib/saip-tool.py
The file was modifieddocs/osmo-smdpp.rst
The file was modifiedpySim/commands.py
The file was modifiedpySim/javacard.py
The file was modifieddocs/legacy.rst
The file was modifiedpySim-smpp2sim.py
The file was modifiedpySim-shell.py
The file was modifiedpySim/esim/rsp.py
The file was modifiedosmo-smdpp.py
The file was modifiedpySim/esim/es9p.py
The file was modifiedpySim/filesystem.py
The file was modifiedpySim/legacy/cards.py
The file was modifiedpySim-trace.py
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/legacy/utils.py
Commit 947154639c9ac57da76fbc6235818df4c93e2ec3 by laforge
pySim.esim.saip.FsNodeADF: Fix __str__ method

It's quite common for a FsNodeADF to not have a df_name, so we need
to guard against that during stringification to avoid an exception.

Change-Id: I919d7c46575e0ebcdf3b979347a5cdd1a9feb294
The file was modifiedpySim/esim/saip/__init__.py
Commit e4ea1c997348370ba1d7415bfd926ac873b58c87 by Oliver Smith
Pass pylint 3.3.4 from debian trixie

************* Module osmo-smdpp
osmo-smdpp.py:657:72: E0606: Possibly using variable 'iccid_str' before assignment (possibly-used-before-assignment)

=> False-positive: code paths that don't set iccid_str raise an error, so
   this shouldn't be a problem.

************* Module pySim-smpp2sim
pySim-smpp2sim.py:427:4: E1101: Module 'twisted.internet.reactor' has no 'run' member (no-member)

=> False-positive: pylint doesn't recognize dynamically set attributes

************* Module es9p_client
contrib/es9p_client.py:126:11: E0606: Possibly using variable 'opts' before assignment (possibly-used-before-assignment)

=> Real bug, should be "self.opts"

Change-Id: Id042ba0944b58d98d27e1222ac373c7206158a91
The file was modifiedosmo-smdpp.py
The file was modifiedpyproject.toml
The file was modifiedcontrib/es9p_client.py