lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

October 2023

  • 1 participants
  • 1843 discussions
[S] Change in pysim[master]: utils: Fix bertlv_encode_tag() for multi-byte tags
by laforge 23 Oct '23

23 Oct '23
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34851?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: utils: Fix bertlv_encode_tag() for multi-byte tags ...................................................................... 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 --- M pySim/utils.py 1 file changed, 28 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/34851/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34851?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b Gerrit-Change-Number: 34851 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[L] Change in pysim[master]: Initial support for eUICC
by laforge 23 Oct '23

23 Oct '23
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34852?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: Initial support for eUICC ...................................................................... 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 Related: OS#6230 --- M pySim-shell.py A pySim/euicc.py M pySim/global_platform.py 3 files changed, 350 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/52/34852/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34852?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ieab37b083e25d3f36c20f6e9ed3e4bdfdd14a42a Gerrit-Change-Number: 34852 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: utils: Fix bertlv_encode_tag() for multi-byte tags
by laforge 23 Oct '23

23 Oct '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34851?usp=email ) Change subject: utils: Fix bertlv_encode_tag() for multi-byte tags ...................................................................... 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 --- M pySim/utils.py 1 file changed, 28 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/34851/1 diff --git a/pySim/utils.py b/pySim/utils.py index 6cacdaa..666f728 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -262,15 +262,22 @@ remainder = inp & ~ (inp << (remain_bits - bitcnt)) return outp, remainder + def count_int_bytes(inp: int) -> int: + """count the number of bytes require to represent the given integer.""" + i = 1 + inp = inp >> 8 + while inp: + i += 1 + inp = inp >> 8 + return i + if isinstance(t, int): - # FIXME: multiple byte tags - tag = t & 0x1f - constructed = True if t & 0x20 else False - cls = t >> 6 - else: - tag = t['tag'] - constructed = t['constructed'] - cls = t['class'] + # first convert to a dict representation + tag_size = count_int_bytes(t) + t, remainder = bertlv_parse_tag(t.to_bytes(tag_size)) + tag = t['tag'] + constructed = t['constructed'] + cls = t['class'] if tag <= 30: t = tag & 0x1f if constructed: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34851?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b Gerrit-Change-Number: 34851 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in pysim[master]: Initial support for eUICC
by laforge 23 Oct '23

23 Oct '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34852?usp=email ) Change subject: Initial support for eUICC ...................................................................... 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 Related: OS#6230 --- M pySim-shell.py A pySim/euicc.py M pySim/global_platform.py 3 files changed, 352 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/52/34852/1 diff --git a/pySim-shell.py b/pySim-shell.py index 022b276..bbb14b2 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -77,6 +77,7 @@ import pySim.ts_31_104 import pySim.ara_m import pySim.global_platform +import pySim.euicc from pySim.card_key_provider import CardKeyProviderCsv, card_key_provider_register, card_key_provider_get_field diff --git a/pySim/euicc.py b/pySim/euicc.py new file mode 100644 index 0000000..c189aaf --- /dev/null +++ b/pySim/euicc.py @@ -0,0 +1,330 @@ +# -*- coding: utf-8 -*- + +""" +Various definitions related to GSMA eSIM / eUICC + +Related Specs: GSMA SGP.22, GSMA SGP.02, etc. +""" + +# Copyright (C) 2023 Harald Welte <laforge(a)osmocom.org> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +from pySim.tlv import * +from pySim.construct import * +from construct import Optional as COptional +from construct import * +import argparse +from cmd2 import cmd2, CommandSet, with_default_category +from pySim.commands import SimCardCommands +from pySim.filesystem import CardADF, CardApplication +from pySim.utils import Hexstr, SwHexstr +import pySim.global_platform + +# Application Identifiers as defined in GSMA SGP.02 Annex H +AID_ISD_R = "A0000005591010FFFFFFFF8900000100" +AID_ECASD = "A0000005591010FFFFFFFF8900000200" +AID_ISD_P_FILE = "A0000005591010FFFFFFFF8900000D00" +AID_ISD_P_MODULE = "A0000005591010FFFFFFFF8900000E00" + +sw_isdr = { + 'ISD-R': { + '6a80': 'Incorrect values in command data', + '6a82': 'Profile not found', + '6a88': 'Reference data not found', + '6985': 'Conditions of use not satisfied', + } +} + +class SupportedVersionNumber(BER_TLV_IE, tag=0x82): + _construct = GreedyBytes + +class IsdrProprietaryApplicationTemplate(BER_TLV_IE, tag=0xe0, nested=[SupportedVersionNumber]): + # FIXME: lpaeSupport - what kind of tag would it have? + pass + +# GlobalPlatform 2.1.1 Section 9.9.3.1 from pySim/global_platform.py extended with E0 +class FciTemplate(BER_TLV_IE, tag=0x6f, nested=pySim.global_platform.FciTemplateNestedList + + [IsdrProprietaryApplicationTemplate]): + pass + + +# SGP.22 Section 5.7.3: GetEuiccConfiguredAddresses +class DefaultDpAddress(BER_TLV_IE, tag=0x80): + _construct = Utf8Adapter(GreedyBytes) +class RootDsAddress(BER_TLV_IE, tag=0x81): + _construct = Utf8Adapter(GreedyBytes) +class EuiccConfiguredAddresses(BER_TLV_IE, tag=0xbf3c, nested=[DefaultDpAddress, RootDsAddress]): + pass + +# SGP.22 Section 5.7.4: SetDefaultDpAddress +class SetDefaultDpAddrRes(BER_TLV_IE, tag=0x80): + _construct = Enum(Int8ub, ok=0, undefinedError=127) +class SetDefaultDpAddress(BER_TLV_IE, tag=0xbf3f, nested=[DefaultDpAddress, SetDefaultDpAddrRes]): + pass + +# SGP.22 Section 5.7.7: GetEUICCChallenge +class EuiccChallenge(BER_TLV_IE, tag=0x80): + _construct = HexAdapter(Bytes(16)) +class GetEuiccChallenge(BER_TLV_IE, tag=0xbf2e, nested=[EuiccChallenge]): + pass + +# SGP.22 Section 5.7.9: ListNotification +class ProfileMgmtOperation(BER_TLV_IE, tag=0x81): + _construct = FlagsEnum(Byte, install=1, enable=2, disable=4, delete=8) +class ListNotificationReq(BER_TLV_IE, tag=0xbf28, nested=[ProfileMgmtOperation]): + pass +class SeqNumber(BER_TLV_IE, tag=0x81): + _construct = Int8ub +class NotificationAddress(BER_TLV_IE, tag=0x82): + _construct = Utf8Adapter(GreedyBytes) +class Iccid(BER_TLV_IE, tag=0x5a): + _construct = HexAdapter(GreedyBytes) +class NotificationMetadata(BER_TLV_IE, tag=0xbf2f, nested=[SeqNumber, ProfileMgmtOperation, + NotificationAddress, Iccid]): + pass +class NotificationMetadataList(BER_TLV_IE, tag=0xa0, nested=[NotificationMetadata]): + pass +class ListNotificationsResultError(BER_TLV_IE, tag=0x81): + _construct = Enum(Int8ub, undefinedError=127) +class ListNotificationResp(BER_TLV_IE, tag=0xbf28, nested=[NotificationMetadataList, + ListNotificationsResultError]): + pass + +# SGP.22 Section 5.7.11: RemoveNotificationFromList +class SeqNumber(BER_TLV_IE, tag=0x80): + _construct = Int8ub # FIXME: variable-sized? +class DeleteNotificationStatus(BER_TLV_IE, tag=0x80): + _construct = Enum(Int8ub, ok=0, nothingToDelete=1, undefinedError=127) +class NotificationSentReq(BER_TLV_IE, tag=0xbf30, nested=[SeqNumber]): + pass +class NotificationSentResp(BER_TLV_IE, tag=0xbf30, nested=[DeleteNotificationStatus]): + pass + +# SGP.22 Section 5.7.12: LoadCRL: FIXME +class LoadCRL(BER_TLV_IE, tag=0xbf35, nested=[]): # FIXME + pass + +# SGP.22 Section 5.7.16:: EnableProfile +class RefreshFlag(BER_TLV_IE, tag=0x88): # FIXME + _construct = Int8ub # FIXME +class IsdpAid(BER_TLV_IE, tag=0x4f): + _construct = HexAdapter(GreedyBytes) +class EnableResult(BER_TLV_IE, tag=0x80): + _construct = Enum(Int8ub, ok=0, iccidOrAidNotFound=1, profileNotInDisabledState=2, + disallowedByPolicy=3, wrongProfileReenabling=4, catBusy=5, undefinedError=127) +class EnableProfileReq(BER_TLV_IE, tag=0xbf31, nested=[IsdpAid, Iccid, RefreshFlag]): + pass +class EnableProfileResp(BER_TLV_IE, tag=0xbf31, nested=[EnableResult]): + pass + +# SGP.22 Section 5.7.17 DisableProfile +class DisableResult(BER_TLV_IE, tag=0x80): + _construct = Enum(Int8ub, ok=0, iccidOrAidNotFound=1, profileNotInEnabledState=2, + disallowedByPolicy=3, catBusy=5, undefinedError=127) +class DisableProfileReq(BER_TLV_IE, tag=0xbf32, nested=[IsdpAid, Iccid, RefreshFlag]): + pass +class DisableProfileResp(BER_TLV_IE, tag=0xbf32, nested=[DisableResult]): + pass + +# SGP.22 Section 5.7.18: DeleteProfile +class DeleteResult(BER_TLV_IE, tag=0x80): + _construct = Enum(Int8ub, ok=0, iccidOrAidNotFound=1, profileNotInDisabledState=2, + disallowedByPolicy=3, undefinedError=127) +class DeleteProfileReq(BER_TLV_IE, tag=0xbf33, nested=[IsdpAid, Iccid]): + pass +class DeleteProfileResp(BER_TLV_IE, tag=0xbf33, nested=[DeleteResult]): + pass + +# SGP.22 Section 5.7.20 GetEID +class TagList(BER_TLV_IE, tag=0x5c): + _construct = GreedyRange(Int8ub) +class EidValue(BER_TLV_IE, tag=0x5a): + _construct = HexAdapter(GreedyBytes) +class GetEuiccData(BER_TLV_IE, tag=0xbf3e, nested=[TagList, EidValue]): + pass + + +class ADF_ISDR(CardADF): + def __init__(self, aid=AID_ISD_R, name='ADF.ISD-R', fid=None, sfid=None, + desc='ISD-R Application'): + super().__init__(aid=aid, fid=fid, sfid=sfid, name=name, desc=desc) + self.shell_commands += [self.AddlShellCommands()] + + @staticmethod + def store_data(scc: SimCardCommands, tx_do: Hexstr) -> Tuple[Hexstr, SwHexstr]: + """Perform STORE DATA according to Table 47+48 in Section 5.7.2 of SGP.22. + Only single-block store supported for now.""" + capdu = '%sE29100%02u%s' % (scc.cla4lchan('80'), len(tx_do)//2, tx_do) + return scc._tp.send_apdu_checksw(capdu) + + @staticmethod + def store_data_tlv(scc: SimCardCommands, cmd_do, resp_cls, exp_sw='9000'): + """Transceive STORE DATA APDU with the card, transparently encoding the command data from TLV + and decoding the response data tlv.""" + if cmd_do: + cmd_do_enc = cmd_do.to_tlv() + cmd_do_len = len(cmd_do_enc) + if cmd_do_len > 255: + return ValueError('DO > 255 bytes not supported yet') + else: + cmd_do_enc = b'' + cmd_do_len = 0 + (data, sw) = ADF_ISDR.store_data(scc, b2h(cmd_do_enc)) + if data: + if resp_cls: + resp_do = resp_cls() + resp_do.from_tlv(h2b(data)) + return resp_do + else: + return data + else: + return None + + def decode_select_response(self, data_hex: Hexstr) -> object: + # FIXME: Implement + #return {'raw': data_hex} + #return pySim.global_platform.decode_select_response(data_hex[:-14]) + t = FciTemplate() + t.from_tlv(h2b(data_hex)) + d = t.to_dict() + return flatten_dict_lists(d['fci_template']) + + @with_default_category('Application-Specific Commands') + class AddlShellCommands(CommandSet): + + es10x_store_data_parser = argparse.ArgumentParser() + es10x_store_data_parser.add_argument('TX_DO', help='Hexstring of encoded to-be-transmitted DO') + + @cmd2.with_argparser(es10x_store_data_parser) + def do_es10x_store_data(self, opts): + """Perform a raw STORE DATA command as defined for the ES10x eUICC interface.""" + (data, sw) = ADF_ISDR.store_data(self._cmd.lchan.scc, opts.TX_DO) + + def do_get_euicc_configured_addresses(self, opts): + """Perform an ES10a GetEuiccConfiguredAddresses function.""" + eca = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, EuiccConfiguredAddresses(), EuiccConfiguredAddresses) + d = eca.to_dict() + print(flatten_dict_lists(d['euicc_configured_addresses'])) + + set_def_dp_addr_parser = argparse.ArgumentParser() + set_def_dp_addr_parser.add_argument('DP_ADDRESS', help='Default SM-DP+ address as UTF-8 string') + + @cmd2.with_argparser(set_def_dp_addr_parser) + def do_set_default_dp_address(self, opts): + """Perform an ES10a SetDefaultDpAddress function.""" + sdda_cmd = SetDefaultDpAddress(children=[DefaultDpAddress(decoded=opts.DP_ADDRESS)]) + sdda = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, sdda_cmd, SetDefaultDpAddress) + d = sdda.to_dict() + print(flatten_dict_lists(d['set_default_dp_address'])) + + def do_get_euicc_challenge(self, opts): + """Perform an ES10b GetEUICCChallenge function.""" + gec = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, GetEuiccChallenge(), GetEuiccChallenge) + d = gec.to_dict() + print(flatten_dict_lists(d['get_euicc_challenge'])) + + def do_list_notification(self, opts): + """Perform an ES10b ListNotification function.""" + ln = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, ListNotificationReq(), ListNotificationResp) + d = ln.to_dict() + print(flatten_dict_lists(d['list_notification_resp'])) + + rem_notif_parser = argparse.ArgumentParser() + rem_notif_parser.add_argument('SEQ_NR', type=int, help='Sequence Number of the to-be-removed notification') + + @cmd2.with_argparser(rem_notif_parser) + def do_remove_notification_from_list(self, opts): + """Perform an ES10b RemoveNotificationFromList function.""" + rn_cmd = NotificationSentReq(children=[SeqNumber(decoded=opts.SEQ_NR)]) + rn = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, rn_cmd, NotificationSentResp) + d = rn.to_dict() + print(flatten_dict_lists(d['notification_sent_resp'])) + + en_prof_parser = argparse.ArgumentParser() + en_prof_grp = en_prof_parser.add_mutually_exclusive_group() + en_prof_grp.add_argument('--isdp-aid', help='Profile identified by its ISD-P AID') + en_prof_grp.add_argument('--iccid', help='Profile identified by its ICCID') + en_prof_parser.add_argument('--refresh-required', action='store_true', help='whether a REFRESH is required') + + @cmd2.with_argparser(en_prof_parser) + def do_enable_profile(self, opts): + """Perform an ES10c EnableProfile function.""" + ep_cmd_contents = [] + if opts.isdp_aid: + ep_cmd_contents.append(IsdpAid(decoded=opts.isdp_aid)) + if opts.iccid: + ep_cmd_contents.append(Iccid(decoded=opts.iccid)) + if opts.refresh_required: + ep_cmd_contents.append(RefreshFlag()) + ep_cmd = EnableProfileReq(children=ep_cmd_contents) + ep = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, ep_cmd, EnableProfileResp) + d = ep.to_dict() + print(flatten_dict_lists(d['enable_profile_resp'])) + + dis_prof_parser = argparse.ArgumentParser() + dis_prof_grp = dis_prof_parser.add_mutually_exclusive_group() + dis_prof_grp.add_argument('--isdp-aid', help='Profile identified by its ISD-P AID') + dis_prof_grp.add_argument('--iccid', help='Profile identified by its ICCID') + dis_prof_parser.add_argument('--refresh-required', action='store_true', help='whether a REFRESH is required') + + @cmd2.with_argparser(dis_prof_parser) + def do_disable_profile(self, opts): + """Perform an ES10c DisableProfile function.""" + dp_cmd_contents = [] + if opts.isdp_aid: + dp_cmd_contents.append(IsdpAid(decoded=opts.isdp_aid)) + if opts.iccid: + dp_cmd_contents.append(Iccid(decoded=opts.iccid)) + if opts.refresh_required: + dp_cmd_contents.append(RefreshFlag()) + dp_cmd = DisableProfileReq(children=dp_cmd_contents) + dp = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, dp_cmd, DisableProfileResp) + d = dp.to_dict() + print(flatten_dict_lists(d['disable_profile_resp'])) + + del_prof_parser = argparse.ArgumentParser() + del_prof_grp = del_prof_parser.add_mutually_exclusive_group() + del_prof_grp.add_argument('--isdp-aid', help='Profile identified by its ISD-P AID') + del_prof_grp.add_argument('--iccid', help='Profile identified by its ICCID') + + @cmd2.with_argparser(del_prof_parser) + def do_delete_profile(self, opts): + """Perform an ES10c DeleteProfile function.""" + dp_cmd_contents = [] + if opts.isdp_aid: + dp_cmd_contents.append(IsdpAid(decoded=opts.isdp_aid)) + if opts.iccid: + dp_cmd_contents.append(Iccid(decoded=opts.iccid)) + dp_cmd = DeleteProfileReq(children=dp_cmd_contents) + dp = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, dp_cmd, DeleteProfileResp) + d = dp.to_dict() + print(flatten_dict_lists(d['delete_profile_resp'])) + + + def do_get_eid(self, opts): + """Perform an ES10c GetEID function.""" + (data, sw) = ADF_ISDR.store_data(self._cmd.lchan.scc, 'BF3E035C015A') + ged_cmd = GetEuiccData(children=[TagList(decoded=[0x5A])]) + ged = ADF_ISDR.store_data_tlv(self._cmd.lchan.scc, ged_cmd, GetEuiccData) + d = ged.to_dict() + print(flatten_dict_lists(d['get_euicc_data'])) + + + + + +class CardApplicationISDR(CardApplication): + def __init__(self): + super().__init__('ISD-R', adf=ADF_ISDR(), sw=sw_isdr) diff --git a/pySim/global_platform.py b/pySim/global_platform.py index bfa2adf..136cccc 100644 --- a/pySim/global_platform.py +++ b/pySim/global_platform.py @@ -174,11 +174,14 @@ MaximumLengthOfDataFieldInCommandMessage]): pass +# explicitly define this list and give it a name so pySim.euicc can reference it +FciTemplateNestedList = [ApplicationID, SecurityDomainManagementData, + ApplicationProductionLifeCycleData, + MaximumLengthOfDataFieldInCommandMessage, + ProprietaryData] + # GlobalPlatform 2.1.1 Section 9.9.3.1 -class FciTemplate(BER_TLV_IE, tag=0x6f, nested=[ApplicationID, SecurityDomainManagementData, - ApplicationProductionLifeCycleData, - MaximumLengthOfDataFieldInCommandMessage, - ProprietaryData]): +class FciTemplate(BER_TLV_IE, tag=0x6f, nested=FciTemplateNestedList): pass class IssuerIdentificationNumber(BER_TLV_IE, tag=0x42): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34852?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ieab37b083e25d3f36c20f6e9ed3e4bdfdd14a42a Gerrit-Change-Number: 34852 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: gsmtap_util: Use Osmo IO instead of Osmo write queues
by arehbein 22 Oct '23

22 Oct '23
Attention is currently required from: daniel, laforge, pespin. arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email ) Change subject: gsmtap_util: Use Osmo IO instead of Osmo write queues ...................................................................... Patch Set 6: (1 comment) File src/core/gsmtap_util.c: https://gerrit.osmocom.org/c/libosmocore/+/34743/comment/ad6358bb_936cc4f4 PS5, Line 478: osmo_iofd_setup(gti, gti->sink_fd, "gsmtap_inst.out", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_sink_ops, NULL); > I have (for now) fixed the memleak keeping Osmo IO, since it was a quick fix and I'm not entirely I […] P.s.: I assume this isn't anything Osmo IO should be implementing, because this is more of a fringe case (actually reading data just to discard it)? -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iadbbef74e3add7001d84dd6b68f51eac293e44d0 Gerrit-Change-Number: 34743 Gerrit-PatchSet: 6 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Sun, 22 Oct 2023 13:53:27 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de> Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: gsmtap_util: Use Osmo IO instead of Osmo write queues
by arehbein 22 Oct '23

22 Oct '23
Attention is currently required from: daniel, laforge, pespin. arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email ) Change subject: gsmtap_util: Use Osmo IO instead of Osmo write queues ...................................................................... Patch Set 5: (1 comment) File src/core/gsmtap_util.c: https://gerrit.osmocom.org/c/libosmocore/+/34743/comment/c7aff446_40c571ac PS5, Line 478: osmo_iofd_setup(gti, gti->sink_fd, "gsmtap_inst.out", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_sink_ops, NULL); I have (for now) fixed the memleak keeping Osmo IO, since it was a quick fix and I'm not entirely I understand what you mean by > simply never read from that fd and just keep it open there so no ICMP errors are sent ? I would think it means returning after the `fd = gsmtap_source_add_sink_fd(gsmtap_inst_fd2(gti));` line in `gsmtap_source_add_sink()`, but then I wouldn't understand why the call to `read()` was added to the Osmo FD callback in the original code. I can of course also just go back to what the code did before (regarding sink functionality), but I thought I'd ask, since you mentioned these two options. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iadbbef74e3add7001d84dd6b68f51eac293e44d0 Gerrit-Change-Number: 34743 Gerrit-PatchSet: 5 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Sun, 22 Oct 2023 13:51:16 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: gsmtap_util: Use Osmo IO instead of Osmo write queues
by arehbein 22 Oct '23

22 Oct '23
Attention is currently required from: arehbein, laforge, pespin. Hello Jenkins Builder, daniel, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email to look at the new patch set (#6). The following approvals got outdated and were removed: Code-Review+1 by pespin, Verified+1 by Jenkins Builder Change subject: gsmtap_util: Use Osmo IO instead of Osmo write queues ...................................................................... gsmtap_util: Use Osmo IO instead of Osmo write queues - Adapt decl. of 'struct gsmtap_inst' for usage of Osmo IO while maintaining backwards compatibility - Maintain legacy behavior without any message queues if osmo_io_mode is zero Related: OS#6213 Change-Id: Iadbbef74e3add7001d84dd6b68f51eac293e44d0 --- M src/core/gsmtap_util.c 1 file changed, 66 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/34743/6 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iadbbef74e3add7001d84dd6b68f51eac293e44d0 Gerrit-Change-Number: 34743 Gerrit-PatchSet: 6 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: RuntimeState: Add type annotation for 'card' argument
by laforge 22 Oct '23

22 Oct '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34845?usp=email ) Change subject: RuntimeState: Add type annotation for 'card' argument ...................................................................... RuntimeState: Add type annotation for 'card' argument Change-Id: I3c5138a918f7e45aabe3972883714d05ee704877 --- M pySim/runtime.py 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/runtime.py b/pySim/runtime.py index d6c6d19..88de69e 100644 --- a/pySim/runtime.py +++ b/pySim/runtime.py @@ -38,7 +38,7 @@ class RuntimeState: """Represent the runtime state of a session with a card.""" - def __init__(self, card, profile: 'CardProfile'): + def __init__(self, card: 'CardBase', profile: 'CardProfile'): """ Args: card : pysim.cards.Card instance -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34845?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I3c5138a918f7e45aabe3972883714d05ee704877 Gerrit-Change-Number: 34845 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: cards.py: Fix type annotation
by laforge 22 Oct '23

22 Oct '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34843?usp=email ) Change subject: cards.py: Fix type annotation ...................................................................... cards.py: Fix type annotation The CardBaes 'scc' member refers to a SimCardCommands instance, not to a LinkBase. Change-Id: If4c0dfbd8c9a03d1a0bc4129bb3c5d5fa492d4cb --- M pySim/cards.py 1 file changed, 17 insertions(+), 6 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/cards.py b/pySim/cards.py index b1adcf2..84f53e1 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -25,15 +25,14 @@ from typing import Optional, Dict, Tuple from pySim.ts_102_221 import EF_DIR from pySim.ts_51_011 import DF_GSM -from pySim.transport import LinkBase import abc from pySim.utils import * -from pySim.commands import Path +from pySim.commands import Path, SimCardCommands class CardBase: """General base class for some kind of telecommunications card.""" - def __init__(self, scc: LinkBase): + def __init__(self, scc: SimCardCommands): self._scc = scc self._aids = [] @@ -75,7 +74,7 @@ any higher-layer processing.""" name = 'SIM' - def __init__(self, scc: LinkBase): + def __init__(self, scc: SimCardCommands): super(SimCardBase, self).__init__(scc) self._scc.cla_byte = "A0" self._scc.sel_ctrl = "0000" @@ -88,7 +87,7 @@ class UiccCardBase(SimCardBase): name = 'UICC' - def __init__(self, scc: LinkBase): + def __init__(self, scc: SimCardCommands): super(UiccCardBase, self).__init__(scc) self._scc.cla_byte = "00" self._scc.sel_ctrl = "0004" # request an FCP @@ -162,7 +161,7 @@ return self._scc.select_adf(aid) return (None, None) -def card_detect(scc: LinkBase) -> Optional[CardBase]: +def card_detect(scc: SimCardCommands) -> Optional[CardBase]: # UICC always has higher preference, as a UICC might also contain a SIM application uicc = UiccCardBase(scc) if uicc.probe(): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34843?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: If4c0dfbd8c9a03d1a0bc4129bb3c5d5fa492d4cb Gerrit-Change-Number: 34843 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: pySim-shell: Create/delete RuntimeLchan objects on open/close of channel
by laforge 22 Oct '23

22 Oct '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34844?usp=email ) Change subject: pySim-shell: Create/delete RuntimeLchan objects on open/close of channel ...................................................................... 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 --- M pySim-shell.py 1 file changed, 21 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim-shell.py b/pySim-shell.py index a79949c..867795c 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -948,6 +948,8 @@ """Open a logical channel.""" (data, sw) = self._cmd.card._scc.manage_channel( mode='open', lchan_nr=opts.chan_nr) + # this is executed only in successful case, as unsuccessful raises exception + self._cmd.lchan.add_lchan(opts.chan_nr) close_chan_parser = argparse.ArgumentParser() close_chan_parser.add_argument( @@ -958,6 +960,8 @@ """Close a logical channel.""" (data, sw) = self._cmd.card._scc.manage_channel( mode='close', lchan_nr=opts.chan_nr) + # this is executed only in successful case, as unsuccessful raises exception + self._cmd.rs.del_lchan(opts.chan_nr) def do_status(self, opts): """Perform the STATUS command.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34844?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Idacee2dc57e8afe85c79bc85b259064e7f5b83a2 Gerrit-Change-Number: 34844 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • ...
  • 185
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.