aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-03-10WIP: saip.data_sourcelaforge/wipHarald Welte2-0/+133
Change-Id: Ia6f70ff467ba58024d94742ba5cecd8141b93ad6
2024-03-10WIP: global_platform: LOAD and INSTALL [for load] supportHarald Welte1-0/+74
Change-Id: I924aaeecbb3a72bdb65eefbff6135e4e9570579e
2024-03-10setup.py: Expose pySim.esim as packageHarald Welte1-1/+2
Change-Id: I524d2b160e743e9a75d08d3bb285ed5781e65c59
2024-03-10HACK: saip-test.pyHarald Welte1-0/+100
Change-Id: I97601e758fd5c5423bb48d3849daf58681a6c5c9
2024-03-02tests: assertEquals() is deprecated, use assertEqual()Vadim Yanitskiy1-5/+5
This fixes deprecation warnings printed by Python 3.11.7. Change-Id: I1de93b0fee9e8439f7da8a3b9fd2a6974973fb4f
2024-02-21saip.personalization: Fix encoding of ICCID in ProfileHeaderHarald Welte1-1/+1
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
2024-02-21saip.personalization: automatically compute class 'name' attributeHarald Welte1-2/+2
We can use the metaclass to set a proper non-camel-case name attribute. Change-Id: If02df436c8f5ce01d21e9ee077ad3736e669d103
2024-02-21saip.personalization: differentiate input_value from valueHarald Welte1-20/+32
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
2024-02-21saip.personalization: Add support for SCP80/81/02/03 keysHarald Welte1-0/+94
Those keys are normally per-card unique, and hence the personalization must be able to modify them in the profile. Change-Id: Ibe4806366f1cce8edb09d52613b1dd56250fa5ae
2024-02-21saip.personalization: include encode/decode of value; add validation methodHarald Welte2-14/+77
Change-Id: Ia9fa39c25817448afb191061acd4be894300eeef
2024-02-21osmo-smdpp: Add TS.48 profiles modified for unique ICCIDsHarald Welte18-0/+0
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
2024-02-20osmo-smdpp: Get rid of hard-coded ICCIDHarald Welte1-1/+5
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
2024-02-18saip: improve docstringsHarald Welte2-3/+21
Change-Id: I0ca82a434e0bde3dc1b304dfc179d568588631c6
2024-02-18pylint: esim/saip/validation.pyHarald Welte1-2/+1
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
2024-02-18pylint: esim/saip/__init__.pyHarald Welte1-5/+4
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
2024-02-18saip: profile processing; merging with templatesHarald Welte2-0/+157
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
2024-02-18asn1/saip: Fix typo in original ASN.1: Compontents -> ComponentsHarald Welte1-1/+1
Change-Id: I6bec5625579873a9ec267d896584608c9d5e3a2f
2024-02-18utils: Add function to verify Luhn check digits and to sanitize ICCIDsHarald Welte2-1/+47
Change-Id: I7812420cf97984dd834fca6a38c5e5ae113243cb
2024-02-15Dynamically determine maximum CMD data length depending on SCPHarald Welte3-6/+20
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
2024-02-12Add terminal_capability command to send TERMINAL CAPABILITYHarald Welte2-2/+122
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
2024-02-12ts_31_102: Add support for "USIM supporting non-IMSI SUPI Type"Harald Welte1-3/+13
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
2024-02-09Introduce code for ES2+ API client functionalityHarald Welte4-2/+540
Change-Id: Id652bb4c2df8893a824b8bb44beeafdfbb91de3f
2024-02-06global_platform: Add --suppress-key-check option to put_key commandHarald Welte1-0/+7
In some cases we may not want to auto-generate the Key Check Values. Change-Id: I244b717b3e3aae6eb3ad512f9e23ff0b65958bb7
2024-02-05pySim-shell: Fix regression in 'apdu' command on cards without profileHarald Welte1-1/+1
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
2024-02-05global_platform: Fix INSTALL [for personalization]Harald Welte1-1/+1
The APDU hex string needs to use %02x instead of %02u... Change-Id: Ic3b30ba623ee04f5190c77afd226b52165b3183f
2024-02-05pylint: global_platform/__init__.pyHarald Welte1-23/+18
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
2024-02-05pylint: construct.pyHarald Welte1-25/+27
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
2024-02-05pylint: tlv.pyHarald Welte1-35/+20
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
2024-02-05pylint: utils.pyHarald Welte1-23/+21
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
2024-02-05pylint: ts_102_222.pyHarald Welte1-21/+17
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
2024-02-05pylint: filesystem.pyHarald Welte2-71/+56
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
2024-02-05pylint: commands.pyHarald Welte1-27/+25
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
2024-02-05pylint: pySim/euicc.pyHarald Welte1-23/+23
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
2024-02-05pylint: runtime.pyHarald Welte1-19/+15
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
2024-02-05pylint: ara_m.pyHarald Welte1-17/+12
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
2024-02-05pylint: ts_102_221.pyHarald Welte1-27/+22
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
2024-02-05pylint: apdu/ts_102_221.pyHarald Welte1-19/+15
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
2024-02-05pylint: ts_31_102.pyHarald Welte1-27/+17
Change-Id: I5b72ad476d338aa4048bb15a74796ef69191f028
2024-02-05pylint: sysmocom_sja2.pyHarald Welte1-5/+6
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
2024-02-05pylint: cdma_ruim.pyHarald Welte1-3/+4
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
2024-02-05pylint: global_platform/scp.pyHarald Welte1-18/+15
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
2024-02-05pylint: esim/saip/oid.pyHarald Welte1-2/+2
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
2024-02-05pylint: esim/saip/templates.pyHarald Welte1-6/+6
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
2024-02-05pylint: esim/saip/personalization.pyHarald Welte1-2/+2
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
2024-02-05pylint: esim/rsp.pyHarald Welte1-3/+0
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
2024-02-05pylint: esim/x509_cert.pyHarald Welte1-6/+4
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
2024-02-05pylint: pySim/esim/bsp.pyHarald Welte1-8/+5
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
2024-02-05pylint: apdu/__init__.pyHarald Welte1-22/+15
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
2024-02-05pylint: apdu/ts_31_102.pyHarald Welte1-4/+2
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
2024-02-05pylint: apdu_source/pyshark_rsproHarald Welte1-3/+1
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