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

July 2024

  • 1 participants
  • 1379 discussions
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_pmm_idle_rx_mt_data
by pespin 26 Jul '24

26 Jul '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37646?usp=email ) Change subject: sgsn: Introduce test TC_pmm_idle_rx_mt_data ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37646?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I35d660b8e546f6ce0af8c05d7b5c56833a26fb76 Gerrit-Change-Number: 37646 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 26 Jul 2024 17:29:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: library/GTPv1U_Templates: Mark parameters as templates
by pespin 26 Jul '24

26 Jul '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email ) Change subject: library/GTPv1U_Templates: Mark parameters as templates ...................................................................... library/GTPv1U_Templates: Mark parameters as templates Change-Id: I278f7dbc64704c1ba2b8a75d6f540ac52b067598 --- M library/GTPv1U_Templates.ttcn 1 file changed, 32 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/37645/1 diff --git a/library/GTPv1U_Templates.ttcn b/library/GTPv1U_Templates.ttcn index a31e1d2..f53035a 100644 --- a/library/GTPv1U_Templates.ttcn +++ b/library/GTPv1U_Templates.ttcn @@ -55,7 +55,10 @@ } /* generalized GTP-U send template */ - template (value) PDU_GTPU ts_GTP1U_PDU(OCT1 msg_type, template (omit) uint16_t seq, OCT4 teid, GTPU_IEs ies) := { + template (value) PDU_GTPU ts_GTP1U_PDU(template (value) OCT1 msg_type, + template (omit) uint16_t seq, + template (value) OCT4 teid, + template (value) GTPU_IEs ies) := { /* N-PDU Number flag (PN): the GTP-U header contains a meaningful N-PDU Number field if the PN * flag is set to 1. */ pn_bit := '0'B, /* we assume the encoder overwrites this if an optional part is given */ @@ -113,12 +116,13 @@ } /* master template for sending a GTP-C echo request */ - template (value) Gtp1uUnitdata ts_GTPU_PING(Gtp1uPeer peer, uint16_t seq) := { + template (value) Gtp1uUnitdata ts_GTPU_PING(template (value) Gtp1uPeer peer, + template (value) uint16_t seq) := { peer := peer, gtpu := ts_GTP1U_PDU('01'O, seq, '00000000'O, valueof(ts_UEchoReqPDU)) } - template GTPU_IEs ts_UEchoRespPDU(OCT1 restart_counter) := { + template GTPU_IEs ts_UEchoRespPDU(template (value) OCT1 restart_counter) := { echoResponse_IEs := { recovery_gtpu := { type_gtpu := '00'O, /* we assume encoder fixes? */ @@ -129,23 +133,26 @@ } /* master template for sending a GTP-U echo response */ - template (present) Gtp1uUnitdata ts_GTPU_PONG(Gtp1uPeer peer, uint16_t seq, OCT1 rest_ctr) := { + template (present) Gtp1uUnitdata ts_GTPU_PONG(template (value) Gtp1uPeer peer, + template (value) uint16_t seq, + template (value) OCT1 rest_ctr) := { peer := peer, gtpu := ts_GTP1U_PDU('02'O, seq, '00000000'O, valueof(ts_UEchoRespPDU(rest_ctr))) } - template (value) GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { + template (value) GSNAddress_gtpu ts_UGsnAddr(template (value) octetstring ip_addr) := { type_gtpu := '85'O, - lengthf := lengthof(ip_addr), + lengthf := lengthof(valueof(ip_addr)), gSNAddressValue := ip_addr } - template (value) TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { + template (value) TeidDataI_gtpu ts_UteidDataI(template (value) OCT4 teid) := { type_gtpu := '10'O, teidDataI := teid } - template (value) GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { + template (value) GTPU_IEs ts_UErrorIndication(template (value) OCT4 teid, + template (value) octetstring gsn_addr) := { errorIndication_IEs := { teidDataI_gtpu := ts_UteidDataI(teid), gSNAddress_gtpu := ts_UGsnAddr(gsn_addr), @@ -154,13 +161,19 @@ } /* master template for sending a GTP-U Error indication */ - template (value) Gtp1uUnitdata ts_GTPU_ErrorIndication(Gtp1uPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { + template (value) Gtp1uUnitdata ts_GTPU_ErrorIndication(template (value) Gtp1uPeer peer, + template (value) uint16_t seq, + template (value) OCT4 teid, + template (value) octetstring gsn_addr) := { peer := peer, gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, valueof(ts_UErrorIndication(teid, gsn_addr))) } /* master template for sending a GTP-U user plane data */ - template (value) Gtp1uUnitdata ts_GTP1U_GPDU(Gtp1uPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { + template (value) Gtp1uUnitdata ts_GTP1U_GPDU(template (value) Gtp1uPeer peer, + template (omit) uint16_t seq, + template (value) OCT4 teid, + template (value) octetstring data) := { peer := peer, gtpu := ts_GTP1U_PDU('FF'O, seq, teid, { g_PDU_IEs := { data := data }}) } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I278f7dbc64704c1ba2b8a75d6f540ac52b067598 Gerrit-Change-Number: 37645 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_pmm_idle_rx_mt_data
by pespin 26 Jul '24

26 Jul '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37646?usp=email ) Change subject: sgsn: Introduce test TC_pmm_idle_rx_mt_data ...................................................................... sgsn: Introduce test TC_pmm_idle_rx_mt_data Change-Id: I35d660b8e546f6ce0af8c05d7b5c56833a26fb76 --- M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests_Iu.ttcn M sgsn/expected-results.xml 3 files changed, 75 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/46/37646/1 diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index 7e44f4b..9019194 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -720,6 +720,7 @@ octetstring ggsn_ip_c, /* GGSN IP Control */ octetstring ggsn_ip_u, /* GGSN IP User */ OCT1 ggsn_restart_ctr, /* GGSN Restart Counter */ + boolean direct_tunnel_requested, /* Did SGSN request Direct Tunnel to the GGSN ?*/ OCT4 rnc_tei_u, /* SGSN TEI User */ octetstring rnc_ip_u, /* SGSN IP USer */ @@ -788,6 +789,7 @@ apars.sgsn_ip_u := upd.sgsn_addr_traffic.addressf; apars.sgsn_tei_u := upd.teidDataI.teidDataI; } + apars.direct_tunnel_requested := dti; } altstep as_ggsn_gtp_ctx_upd_req(inout PdpActPars apars, boolean send_recovery := false, @@ -1025,6 +1027,7 @@ ggsn_ip_c := f_inet_addr(ggsn_ip), ggsn_ip_u := f_inet_addr(ggsn_ip), ggsn_restart_ctr := int2oct(2, 1), + direct_tunnel_requested := false, rnc_tei_u := f_rnd_octstring(4), rnc_ip_u := f_inet_addr(rnc_ip), @@ -1047,9 +1050,18 @@ remPort := GTP1C_PORT } -function f_gtpu_send(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { - var Gtp1uPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); - GTP[GTP_GGSN_IDX].send(ts_GTP1U_GPDU(peer, 0 /*seq*/, apars.sgsn_tei_u, payload)); +/* Send data from GGSN to SGSN/RNC (depending on apars.f_ggsn_gtpu_send) */ +function f_ggsn_gtpu_send(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { + var Gtp1uPeer peer; + var OCT4 rem_teid; + if (apars.direct_tunnel_requested) { + peer := valueof(ts_GtpPeerU(apars.rnc_ip_u)); + rem_teid := apars.rnc_tei_u; + } else { + peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); + rem_teid := apars.sgsn_tei_u; + } + GTP[GTP_GGSN_IDX].send(ts_GTP1U_GPDU(peer, 0 /*seq*/, rem_teid, payload)); } altstep as_xid(PdpActPars apars, integer ran_index := 0) runs on BSSGP_ConnHdlr { @@ -1096,7 +1108,7 @@ runs on BSSGP_ConnHdlr { timer T := 5.0; /* Send PDU via GTP from our simulated GGSN to the SGSN */ - f_gtpu_send(apars, payload); + f_ggsn_gtpu_send(apars, payload); T.start; alt { diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn index ff68e0e..f3ffa45 100644 --- a/sgsn/SGSN_Tests_Iu.ttcn +++ b/sgsn/SGSN_Tests_Iu.ttcn @@ -12,6 +12,9 @@ import from RANAP_PDU_Descriptions all; import from RANAP_IEs all; +import from GTPv1U_Templates all; +import from GTP_Emulation all; + import from BSSGP_ConnHdlr all; private function f_init() runs on test_CT { @@ -215,6 +218,51 @@ f_cleanup(); } +/* Test UE going to PMM IDLE state after having activated the PDP context. + * SGSN is expected to update the GGSN cancelling the Direct Tunnel feature. */ +private function f_TC_pmm_idle_rx_mt_data(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip, mp_ranap_cfg[0].sctp_addr.local_ip_addr)); + + /* first perform regular attach */ + f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); + + f_service_request(apars, ran_index := 3); + + f_pdp_ctx_act(apars, ran_index := 3); + + f_iu_release_req(ts_RanapCause_radio_conn_release); + /* Now UE is in PMM IDLE state at the SGSN. + * Expect SGSN to point GTPU at GGSN back to itself: */ + as_ggsn_gtp_ctx_upd_req(apars, exp_dir_tun := false, ran_index := 3); + + /* Now GGSN receives new MT data and forwards it to SGSN: */ + f_gtp_register_teid('00000000'O, GTP_GGSN_IDX); /* Ease debugging in case SGSN sends ErrorInd */ + f_ran_register_imsi(g_pars.imsi, g_pars.p_tmsi); /* Forward Paging below to this component */ + var octetstring payload := f_rnd_octstring(100); + f_ggsn_gtpu_send(apars, payload); + + f_sleep(1.0); + BSSAP.receive(tr_RANAP_Paging(ps_domain, imsi_hex2oct(g_pars.imsi))); + + /* Ue comes back, answering the paging: + * SGSN recreates the Iu ctx and recovers the Direct Tunnel RNC<->GGSN: */ + f_service_request(apars, pdp_status := '2000'O /*NSAPI=5*/, ran_index := 3); + as_ranap_rab_ass_req(apars); + as_ggsn_gtp_ctx_upd_req(apars, exp_dir_tun := true, ran_index := 3); + + /* Now UE is in PMM ENABLED state, tear it down to clean up: */ + f_pdp_ctx_deact_mo(apars, '00'O, ran_index := 3); + setverdict(pass); +} +testcase TC_pmm_idle_rx_mt_data() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_pmm_idle_rx_mt_data), testcasename(), g_gb, 1001); + vc_conn.done; + f_cleanup(); +} + control { execute( TC_iu_attach() ); execute( TC_iu_attach_encr() ); @@ -222,6 +270,7 @@ execute( TC_geran_attach_iu_rau() ); execute( TC_attach_pdp_act_user() ); execute( TC_attach_pdp_act_pmm_idle() ); + execute( TC_pmm_idle_rx_mt_data() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 7b38e99..3461721 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -95,6 +95,7 @@ <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle_lost_pdp_status' time='MASKED'/> + <testcase classname='SGSN_Tests_Iu' name='TC_pmm_idle_rx_mt_data' time='MASKED'/> <!-- SGSN_Tests_NS (handle_sns == true) testcases start here --> <testcase classname='SGSN_Tests_NS' name='TC_SNS_size' time='MASKED'/> <testcase classname='SGSN_Tests_NS' name='TC_SNS_size_too_big' time='MASKED'/> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37646?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I35d660b8e546f6ce0af8c05d7b5c56833a26fb76 Gerrit-Change-Number: 37646 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-sgsn[master]: Announce SGSN own TEID during UpdatePDPCtxReq after UE goes PMM-IDLE
by pespin 26 Jul '24

26 Jul '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/37644?usp=email ) Change subject: Announce SGSN own TEID during UpdatePDPCtxReq after UE goes PMM-IDLE ...................................................................... Announce SGSN own TEID during UpdatePDPCtxReq after UE goes PMM-IDLE When the UE/RNC closes the Iu conn (while keeping the PDP Context activated), the SGSN updates the GGSN to point the GTPU tunnel to itself. Unfortunately, only the IP address was being updated while the TEID was kept the same (the one from the RNC). As a result, when new MT data arrived at the GGSN, it would forward it over GTPU to the SGSN using the incorrect RNC TEID, which the libgtp stack at osmo-sgsn would silently drop due to not being known (because it was >PDP_MAX=1024). The issue can be triggered in test SGSN_Tests_Iu.TC_pmm_idle_rx_mt_data. Related: OS#5773 Related: SYS#5435 Change-Id: I782aa43c71569922a945bd44544bb1388bf8c878 --- M include/osmocom/sgsn/pdpctx.h M src/sgsn/gprs_mm_state_iu_fsm.c M src/sgsn/sgsn_libgtp.c 3 files changed, 36 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/37644/1 diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h index f3cf0ed..39d744a 100644 --- a/include/osmocom/sgsn/pdpctx.h +++ b/include/osmocom/sgsn/pdpctx.h @@ -69,6 +69,9 @@ uint8_t radio_prio; //uint32_t charging_id; bool ue_pdp_active; /* PDP Context is active for this NSAPI? */ + /* Keeps original SGSN local TEID when lib->teid_own is updated with + * RNC's TEID upon use of Direct Tunnel feature: */ + uint32_t sgsn_teid_own; struct osmo_timer_list timer; unsigned int T; /* Txxxx number */ diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c index b883278..b376d98 100644 --- a/src/sgsn/gprs_mm_state_iu_fsm.c +++ b/src/sgsn/gprs_mm_state_iu_fsm.c @@ -49,9 +49,11 @@ char buf[INET_ADDRSTRLEN]; struct sgsn_pdp_ctx *pdp; llist_for_each_entry(pdp, &mm_ctx->pdp_list, list) { - LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n", - sgsn_gtp_ntoa(&pdp->lib->gsnlu), - inet_ntop(AF_INET, &sgsn->cfg.gtp_listenaddr.sin_addr, buf, sizeof(buf))); + LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s/0x%08x -> %s/0x%08x\n", + sgsn_gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, + inet_ntop(AF_INET, &sgsn->cfg.gtp_listenaddr.sin_addr, buf, sizeof(buf)), + pdp->sgsn_teid_own); + pdp->lib->teid_own = pdp->sgsn_teid_own; /* Disable Direct Tunnel Flags DTI: */ pdp->lib->dir_tun_flags.l = 1; pdp->lib->dir_tun_flags.v[0] &= 0xFE; diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 4885ada..f497609 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -166,6 +166,9 @@ pdp->priv = pctx; pctx->lib = pdp; + /* Back up our own local TEID in case we update the library one with RNC TEID when setting up Direct Tunnel: */ + pctx->sgsn_teid_own = pdp->teid_own; + //pdp->peer = /* sockaddr_in of GGSN (receive) */ //pdp->ipif = /* not used by library */ pdp->version = ggsn->gtp_version; @@ -783,6 +786,8 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ + LOGMMCTXP(LOGL_INFO, mm, "Rx GTP for UE in PMM state %s, paging it\n", + osmo_fsm_inst_state_name(mm->iu.mm_state_fsm)); ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/37644?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I782aa43c71569922a945bd44544bb1388bf8c878 Gerrit-Change-Number: 37644 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: ara_m: add export support for the ARA-M application
by dexter 26 Jul '24

26 Jul '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37643?usp=email ) Change subject: ara_m: add export support for the ARA-M application ...................................................................... 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 --- M pySim/ara_m.py 1 file changed, 86 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/43/37643/1 diff --git a/pySim/ara_m.py b/pySim/ara_m.py index c283cf0..c327e13 100644 --- a/pySim/ara_m.py +++ b/pySim/ara_m.py @@ -415,3 +415,74 @@ class CardApplicationARAM(CardApplication): def __init__(self): super().__init__('ARA-M', adf=ADF_ARAM(), sw=sw_aram) + + @staticmethod + def export(as_json: bool, lchan): + + # TODO: Add JSON output as soon as aram_store_ref_ar_do is able to process input in JSON format. + if as_json: + raise NotImplementedError("res_do encoder not yet implemented. Patches welcome.") + + export_str = "" + export_str += "aram_delete_all\n" + + res_do = ADF_ARAM.get_all(lchan.scc._tp) + if res_do: + for res_do_dict in res_do.to_dict(): + if 'response_all_ref_ar_do' in res_do_dict and res_do_dict['response_all_ref_ar_do']: + for ref_ar_do_list in res_do_dict['response_all_ref_ar_do']: + ref_do_list = None + ar_do_list = None + if 'ref_ar_do' in ref_ar_do_list: + for ref_ar_do in ref_ar_do_list['ref_ar_do']: + if 'ref_do' in ref_ar_do: + ref_do_list = ref_ar_do['ref_do'] + if 'ar_do' in ref_ar_do: + ar_do_list = ref_ar_do['ar_do'] + + if ref_do_list and ar_do_list: + aid_ref_do = None + dev_app_id_ref_do = None + apdu_ar_do = None + nfc_ar_do = None + perm_ar_do = None + pkg_ref_do = None + for ref_do in ref_do_list: + if 'aid_ref_do' in ref_do: + aid_ref_do = ref_do['aid_ref_do'] + if 'dev_app_id_ref_do' in ref_do: + dev_app_id_ref_do = ref_do['dev_app_id_ref_do'] + if 'pkg_ref_do' in ref_do: + pkg_ref_do = ref_do['pkg_ref_do'] + for ar_do in ar_do_list: + if 'apdu_ar_do' in ar_do: + apdu_ar_do = ar_do['apdu_ar_do'] + if 'nfc_ar_do' in ar_do: + nfc_ar_do = ar_do['nfc_ar_do'] + if 'perm_ar_do' in ar_do: + perm_ar_do = ar_do['perm_ar_do'] + + # Write command-line + export_str += "aram_store_ref_ar_do" + if aid_ref_do: + export_str += (" --aid %s" % aid_ref_do) + else: + export_str += " --aid-empty" + if dev_app_id_ref_do: + export_str += (" --device-app-id %s" % dev_app_id_ref_do) + if apdu_ar_do and 'generic_access_rule' in apdu_ar_do: + export_str += (" --apdu-%s" % apdu_ar_do['generic_access_rule']) + elif apdu_ar_do and 'apdu_filter' in apdu_ar_do: + export_str += (" --apdu-filter ") + for apdu_filter in apdu_ar_do['apdu_filter']: + export_str += apdu_filter['header'] + export_str += apdu_filter['mask'] + if nfc_ar_do and 'nfc_event_access_rule' in nfc_ar_do: + export_str += (" --nfc-%s" % nfc_ar_do['nfc_event_access_rule']) + if perm_ar_do: + export_str += (" --android-permissions %s" % perm_ar_do['permissions']) + if pkg_ref_do: + export_str += (" --pkg-ref %s" % pkg_ref_do['package_name_string']) + export_str += "\n" + + return export_str.strip() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37643?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: I811cb9d25cb8ee194b4ead5fb2cabf1fdc0c1c43 Gerrit-Change-Number: 37643 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: ara_m: fix sourcecode formatting
by dexter 26 Jul '24

26 Jul '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37638?usp=email ) Change subject: ara_m: fix sourcecode formatting ...................................................................... ara_m: fix sourcecode formatting Related: OS#6092 Change-Id: I374eefdd1a2763552c98c1928753197e9f753e2b --- M pySim/ara_m.py 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/38/37638/1 diff --git a/pySim/ara_m.py b/pySim/ara_m.py index 5776e3d..5d8637c 100644 --- a/pySim/ara_m.py +++ b/pySim/ara_m.py @@ -228,16 +228,14 @@ class GetCommandDoCollection(TLV_IE_Collection, nested=[RefDO, DeviceConfigDO]): pass + # SEID v1.1 Table 4-2 - - class GetResponseDoCollection(TLV_IE_Collection, nested=[ResponseAllRefArDO, ResponseArDO, ResponseRefreshTagDO, ResponseAramConfigDO]): pass + # SEID v1.1 Table 5-1 - - class StoreCommandDoCollection(TLV_IE_Collection, nested=[BlockDO, CommandStoreRefArDO, CommandDelete, CommandUpdateRefreshTagDO, CommandRegisterClientAidsDO, -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37638?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: I374eefdd1a2763552c98c1928753197e9f753e2b Gerrit-Change-Number: 37638 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: ara_m: fix misspelled object name
by dexter 26 Jul '24

26 Jul '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37639?usp=email ) Change subject: ara_m: fix misspelled object name ...................................................................... ara_m: fix misspelled object name Related: OS#6092 Change-Id: I2c2289658f099aa1d25a4ab3292dea9a7c16c123 --- M pySim/ara_m.py 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/39/37639/1 diff --git a/pySim/ara_m.py b/pySim/ara_m.py index 5d8637c..6641893 100644 --- a/pySim/ara_m.py +++ b/pySim/ara_m.py @@ -356,7 +356,7 @@ # AR ar_do_content = [] if opts.apdu_never: - ar_do_content += [{'apdu_ar_od': {'generic_access_rule': 'never'}}] + ar_do_content += [{'apdu_ar_do': {'generic_access_rule': 'never'}}] elif opts.apdu_always: ar_do_content += [{'apdu_ar_do': {'generic_access_rule': 'always'}}] elif opts.apdu_filter: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37639?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: I2c2289658f099aa1d25a4ab3292dea9a7c16c123 Gerrit-Change-Number: 37639 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: ara_m: fix --apdu-filter setting
by dexter 26 Jul '24

26 Jul '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37640?usp=email ) Change subject: ara_m: fix --apdu-filter setting ...................................................................... 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 --- M pySim/ara_m.py 1 file changed, 28 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/40/37640/1 diff --git a/pySim/ara_m.py b/pySim/ara_m.py index 6641893..c283cf0 100644 --- a/pySim/ara_m.py +++ b/pySim/ara_m.py @@ -76,13 +76,13 @@ else: if len(do) % 8: return ValueError('Invalid non-modulo-8 length of APDU filter: %d' % len(do)) - self.decoded['apdu_filter'] = [] + self.decoded = {'apdu_filter': []} offset = 0 while offset < len(do): - self.decoded['apdu_filter'] += {'header': b2h(do[offset:offset+4]), - 'mask': b2h(do[offset+4:offset+8])} - self.decoded = res - return res + self.decoded['apdu_filter'] += [{'header': b2h(do[offset:offset+4]), + 'mask': b2h(do[offset+4:offset+8])}] + offset += 8 # Move offset to the beginning of the next apdu_filter object + return self.decoded def _to_bytes(self): if 'generic_access_rule' in self.decoded: @@ -332,7 +332,7 @@ apdu_grp.add_argument( '--apdu-always', action='store_true', help='APDU access is allowed') apdu_grp.add_argument( - '--apdu-filter', help='APDU filter: 4 byte CLA/INS/P1/P2 followed by 4 byte mask (8 hex bytes)') + '--apdu-filter', help='APDU filter: multiple groups of 8 hex bytes (4 byte CLA/INS/P1/P2 followed by 4 byte mask)') nfc_grp = store_ref_ar_do_parse.add_mutually_exclusive_group() nfc_grp.add_argument('--nfc-always', action='store_true', help='NFC event access is allowed') @@ -360,8 +360,15 @@ elif opts.apdu_always: ar_do_content += [{'apdu_ar_do': {'generic_access_rule': 'always'}}] elif opts.apdu_filter: - # TODO: multiple filters - ar_do_content += [{'apdu_ar_do': {'apdu_filter': [opts.apdu_filter]}}] + if len(opts.apdu_filter) % 16: + return ValueError('Invalid non-modulo-8 length of APDU filter: %d' % len(do)) + offset = 0 + apdu_filter = [] + while offset < len(opts.apdu_filter): + apdu_filter += [{'header': opts.apdu_filter[offset:offset+8], + 'mask': opts.apdu_filter[offset+8:offset+16]}] + offset += 16 # Move offset to the beginning of the next apdu_filter object + ar_do_content += [{'apdu_ar_do': {'apdu_filter': apdu_filter}}] if opts.nfc_always: ar_do_content += [{'nfc_ar_do': {'nfc_event_access_rule': 'always'}}] elif opts.nfc_never: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37640?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: Ib5fb388972fde0d50c3db0082ebf40bcca404681 Gerrit-Change-Number: 37640 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim-shell: fix comment formatting
by dexter 26 Jul '24

26 Jul '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37637?usp=email ) Change subject: pySim-shell: fix comment formatting ...................................................................... pySim-shell: fix comment formatting Related: OS#6092 Change-Id: Icea88c061436d26a3240fc666fcc3fe1bd36d2ba --- M pySim-shell.py 1 file changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/37/37637/1 diff --git a/pySim-shell.py b/pySim-shell.py index 8f654bd..168c916 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -813,14 +813,14 @@ @cmd2.with_argparser(activate_file_parser) def do_activate_file(self, opts): """Activate the specified EF by sending an ACTIVATE FILE apdu command (used to be called REHABILITATE -in TS 11.11 for classic SIM). + in TS 11.11 for classic SIM). -This command is used to (re-)activate a file that is currently in deactivated (sometimes also called -"invalidated") state. You need to call this from the DF above the to-be-activated EF and specify the name or -FID of the file to activate. + This command is used to (re-)activate a file that is currently in deactivated (sometimes also called + "invalidated") state. You need to call this from the DF above the to-be-activated EF and specify the name or + FID of the file to activate. -Note that for *deactivation* the to-be-deactivated EF must be selected, but for *activation*, the DF -above the to-be-activated EF must be selected!""" + Note that for *deactivation* the to-be-deactivated EF must be selected, but for *activation*, the DF + above the to-be-activated EF must be selected!""" (data, sw) = self._cmd.lchan.activate_file(opts.NAME) def complete_activate_file(self, text, line, begidx, endidx) -> List[str]: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37637?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: Icea88c061436d26a3240fc666fcc3fe1bd36d2ba Gerrit-Change-Number: 37637 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: filesystem: add export method for ADF files
by dexter 26 Jul '24

26 Jul '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37642?usp=email ) Change subject: filesystem: add export method for ADF files ...................................................................... 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 --- M pySim/filesystem.py 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/37642/1 diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 5414fb9..028b906 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -530,6 +530,13 @@ else: return self.aid + @staticmethod + def export(as_json: bool, lchan): + """ + Export application specific parameters that are not part of the eUICC filesystem. + """ + return lchan.selected_file.application.export(as_json, lchan) + class CardEF(CardFile): """EF (Entry File) in the smart card filesystem""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37642?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: I8129656096ecaf41b36e5f2afbbfbebcd0587886 Gerrit-Change-Number: 37642 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.