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

November 2024

  • 1 participants
  • 2209 discussions
[S] Change in osmo-ttcn3-hacks[master]: hnbgw: Introduce module parameter mp_pfcp_upf_node_id
by pespin 04 Nov '24

04 Nov '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38618?usp=email ) Change subject: hnbgw: Introduce module parameter mp_pfcp_upf_node_id ...................................................................... hnbgw: Introduce module parameter mp_pfcp_upf_node_id This will allow using it later in HNBGW_Tests.ttcn file when waiting for PFCP Assoc Req. Change-Id: I2142289965adba0b457e865e10f0cfc9908b0bb2 --- M hnbgw/ConnHdlr.ttcn M hnbgw/HNBGW_Tests.ttcn 2 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/18/38618/1 diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn index 13c8d4c..44dfbc3 100644 --- a/hnbgw/ConnHdlr.ttcn +++ b/hnbgw/ConnHdlr.ttcn @@ -200,16 +200,17 @@ /* whether we expect HNBGW to manage a UPF through PFCP: */ boolean pfcp_enabled, charstring pfcp_local_addr, - Node_ID upf_node_id, + Node_ID upf_node_id, F_SEID up_f_seid, F_SEID hnbgw_f_seid optional } template (value) PfcpParameters t_PfcpParams(boolean pfcp_enabled := false, - charstring pfcp_local_addr := "127.0.0.1") := { + charstring pfcp_local_addr := "127.0.0.1", + charstring pfcp_upf_node_id := "\07osmocom\03org") := { pfcp_enabled := pfcp_enabled, pfcp_local_addr := pfcp_local_addr, - upf_node_id := valueof(ts_PFCP_Node_ID_fqdn("\07osmocom\03org")), + upf_node_id := valueof(ts_PFCP_Node_ID_fqdn(pfcp_upf_node_id)), up_f_seid := ts_PFCP_F_SEID_ipv4(f_inet_addr(pfcp_local_addr), c_SEID1), hnbgw_f_seid := omit } diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 0e32e63..26d069f 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -211,13 +211,12 @@ }; boolean mp_enable_pfcp_tests := false; - /* IP address at which we listen for PFCP to emulate a UPF in ttcn3 */ charstring mp_pfcp_ip_local := "127.0.0.1"; - /* IP address from which the SUT (osmo-hnbgw) sends PFCP requests, and to which the ttcn3 UPF emulation sends * PFCP responses. */ charstring mp_pfcp_ip_remote := "127.0.0.2"; + charstring mp_pfcp_upf_node_id := "\07osmocom\03org"; boolean mp_validate_talloc_asn1 := true; @@ -516,7 +515,8 @@ var template (value) PfcpParameters pfcp_pars; pfcp_pars := t_PfcpParams(pfcp_enabled := mp_enable_pfcp_tests, - pfcp_local_addr := mp_pfcp_ip_local); + pfcp_local_addr := mp_pfcp_ip_local, + pfcp_upf_node_id := mp_pfcp_upf_node_id); pars := t_pars(imsi_suffix, ps_domain := ps_domain, expect_separate_sccp_cr := expect_separate_sccp_cr, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38618?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2142289965adba0b457e865e10f0cfc9908b0bb2 Gerrit-Change-Number: 38618 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: hnbgw: Introduce module parameter mp_statsd_prefix
by pespin 04 Nov '24

04 Nov '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38617?usp=email ) Change subject: hnbgw: Introduce module parameter mp_statsd_prefix ...................................................................... hnbgw: Introduce module parameter mp_statsd_prefix The value in that parameter depends on IUT configuration. Change-Id: I007d45b8323831e8f3708d22c6a9bc6e9badd896 --- M hnbgw/HNBGW_Tests.ttcn 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/17/38617/1 diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index c917816..0e32e63 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -111,6 +111,7 @@ /* Our emulated StatsD server: */ charstring mp_local_statsd_ip := "127.0.0.1"; integer mp_local_statsd_port := 8125; + charstring mp_statsd_prefix := "TTCN3."; charstring mp_mgw_ip := "127.0.0.1"; integer mp_mgw_port := 2427; @@ -978,7 +979,7 @@ } friend function f_tc_rab_assignment(charstring id) runs on ConnHdlr { - const charstring hnb0_ctr_prefix := "TTCN3.hnb.001-01-L2342-R0-S55-C1."; + const charstring hnb0_ctr_prefix := mp_statsd_prefix & "hnb.001-01-L2342-R0-S55-C1."; var MgcpCommand mgcp_cmd; var RANAP_PDU tx; timer T := 5.0; @@ -1022,7 +1023,7 @@ } friend function f_tc_rab_assign_fail(charstring id) runs on ConnHdlr { - const charstring hnb0_ctr_prefix := "TTCN3.hnb.001-01-L2342-R0-S55-C1."; + const charstring hnb0_ctr_prefix := mp_statsd_prefix & "hnb.001-01-L2342-R0-S55-C1."; var MgcpCommand mgcp_cmd; var RANAP_PDU tx; timer T := 5.0; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38617?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I007d45b8323831e8f3708d22c6a9bc6e9badd896 Gerrit-Change-Number: 38617 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: hnbgw: Handle PFCP Assoc Setup procedure in test_CT
by pespin 04 Nov '24

04 Nov '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38619?usp=email ) Change subject: hnbgw: Handle PFCP Assoc Setup procedure in test_CT ...................................................................... hnbgw: Handle PFCP Assoc Setup procedure in test_CT Handle PFCP Assoc Setup Req during PFCP initialization in main test_CT. This simplifies test logic. Depends: osmo-hnbgw.git Change-Id Ic71df8df83e97f4015077677e426c803f84d31ea Change-Id: Ic5edecea86b9465c60f008e245a44cfce64c8ddb --- M hnbgw/ConnHdlr.ttcn M hnbgw/HNBGW_Tests.ttcn 2 files changed, 60 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/19/38619/1 diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn index 44dfbc3..f6bde48 100644 --- a/hnbgw/ConnHdlr.ttcn +++ b/hnbgw/ConnHdlr.ttcn @@ -769,19 +769,6 @@ f_rab_ass_resp_cs(); } -function f_pfcp_wait_assoc_setup_req() runs on ConnHdlr { - /* ask PFCPEM to route all PDUs to us */ - f_PFCPEM_subscribe_bcast(); - - var PDU_PFCP m; - - m := f_pfcp_expect(tr_PFCP_Assoc_Setup_Req(), wait_time := 15.0); - PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number, g_pars.pfcp_pars.upf_node_id, - ts_PFCP_Cause(REQUEST_ACCEPTED), 1234)); - /* ask PFCPEM to *not* route all PDUs to us anymore */ - f_PFCPEM_unsubscribe_bcast(); -} - function f_rab_ass_req_ps_with_pfcp() runs on ConnHdlr { var RANAP_PDU tx; var RANAP_PDU rx; diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 26d069f..09ddd9c 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -247,7 +247,7 @@ const integer NUM_HNB := 2; -type component test_CT extends CTRL_Adapter_CT, StatsD_Checker_CT { +type component test_CT extends CTRL_Adapter_CT, StatsD_ConnHdlr, PFCP_ConnHdlr { var boolean g_initialized := false; /********************* Iu side */ @@ -314,6 +314,46 @@ vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); } +private function f_statsd_pfcp_associated() runs on test_CT return boolean +{ + var charstring key_name := mp_statsd_prefix & "upf.0.pfcp_associated"; + var StatsDMetricKeys statsd_keys := { valueof(ts_StatsDMetricKey(key_name, "g")) }; + var StatsDMetrics statsd_snapshot; + var boolean pfcp_associated; + + statsd_snapshot := f_statsd_snapshot(statsd_keys, since_last_snapshot := false); + pfcp_associated := statsd_snapshot[0].val == 1; + + return pfcp_associated; +} + +private function f_pfcp_wait_assoc_setup_req() runs on test_CT { + var PDU_PFCP m; + timer T := 15.0; + /* ask PFCPEM to route all PDUs to us */ + f_PFCPEM_subscribe_bcast(); + + T.start; + alt { + [] PFCP.receive(tr_PFCP_Assoc_Setup_Req()) -> value m { + setverdict(pass); + } + [] PFCP.receive(PDU_PFCP:?) { + setverdict(fail, "Got an unexpected PFCP message, was waiting for ", tr_PFCP_Assoc_Setup_Req()); + mtc.stop; + } + [] T.timeout { + setverdict(fail, "Timeout waiting for PFCP ", tr_PFCP_Assoc_Setup_Req()); + mtc.stop; + } + } + T.stop; + PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number, ts_PFCP_Node_ID_fqdn(mp_pfcp_upf_node_id), + ts_PFCP_Cause(REQUEST_ACCEPTED), 1234)); + /* ask PFCPEM to *not* route all PDUs to us anymore */ + f_PFCPEM_unsubscribe_bcast(); +} + function f_init_pfcp(charstring id) runs on test_CT { id := id & "-PFCP"; @@ -327,6 +367,19 @@ vc_PFCP := PFCP_Emulation_CT.create(id) alive; vc_PFCP.start(PFCP_Emulation.main(pfcp_cfg)); + + if (mp_enable_pfcp_tests) { + /* Temporarily access Statsd during test startup: */ + connect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); + if (not f_statsd_pfcp_associated()) { + connect(self:PFCP, vc_PFCP:CLIENT); + connect(self:PFCP_PROC, vc_PFCP:CLIENT_PROC); + f_pfcp_wait_assoc_setup_req(); + disconnect(self:PFCP, vc_PFCP:CLIENT); + disconnect(self:PFCP_PROC, vc_PFCP:CLIENT_PROC); + } + disconnect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); + } } function f_init_hnodeb(charstring id, integer hnb_idx, RuaOps rua_ops) runs on test_CT { @@ -420,6 +473,10 @@ activate(as_Tguard()); f_init_statsd("VirtHNBGW", vc_STATSD, mp_local_statsd_ip, mp_local_statsd_port); + f_init_vty("VirtHNBGW"); + f_ipa_ctrl_start_client(mp_hnbgw_ip, mp_hnbgw_ctrl_port); + + f_init_pfcp(id); /* RUA/RANAP emulation on top of lower-layer Iuh */ var RuaOps rua_ops := { @@ -437,9 +494,6 @@ f_init_hnodeb(testcasename(), i, rua_ops); } - f_init_vty("VirtHNBGW"); - f_ipa_ctrl_start_client(mp_hnbgw_ip, mp_hnbgw_ctrl_port); - /* MSC emulation */ /* Make sure each MSC's internal state is "DISCONNECTED" at first */ @@ -564,10 +618,8 @@ connect(vc_conn:STATSD_PROC, vc_STATSD:STATSD_PROC); - if (isbound(vc_PFCP)) { - connect(vc_conn:PFCP, vc_PFCP:CLIENT); - connect(vc_conn:PFCP_PROC, vc_PFCP:CLIENT_PROC); - } + connect(vc_conn:PFCP, vc_PFCP:CLIENT); + connect(vc_conn:PFCP_PROC, vc_PFCP:CLIENT_PROC); return vc_conn; } @@ -1368,10 +1420,6 @@ friend function f_tc_ps_rab_assignment(charstring id) runs on ConnHdlr { var RANAP_PDU tx; - if (g_pars.pfcp_pars.pfcp_enabled) { - f_pfcp_wait_assoc_setup_req(); - } - tx := f_build_initial_ue(g_pars); f_iuh2iu_connect(tx); @@ -1385,7 +1433,6 @@ var ConnHdlr vc_conn; g_num_hnbs := 1; f_init(); - f_init_pfcp(testcasename()); f_sleep(1.0); vc_conn := f_start_handler_with_pars(refers(f_tc_ps_rab_assignment), f_TestHdlrParams(7, ps_domain := true)); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38619?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic5edecea86b9465c60f008e245a44cfce64c8ddb Gerrit-Change-Number: 38619 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-hnbgw[master]: Add PFCP stats item group
by pespin 04 Nov '24

04 Nov '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38616?usp=email ) Change subject: Add PFCP stats item group ...................................................................... Add PFCP stats item group This will be used by TTCN3 testsuite to figure out whether it should expect a PFCP Assoc Setup from HNBGW. Depends: libosmo-pfcp.git Change-Id Ibc8047856ddcc9c71f2b4cf30f577862b6b414ca Change-Id: Ic71df8df83e97f4015077677e426c803f84d31ea --- M include/osmocom/hnbgw/hnbgw.h M include/osmocom/hnbgw/hnbgw_pfcp.h M src/osmo-hnbgw/hnbgw_pfcp.c M src/osmo-hnbgw/osmo_hnbgw_main.c 4 files changed, 50 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/16/38616/1 diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index caaff5f..afceca8 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -490,6 +490,8 @@ struct { struct osmo_pfcp_endpoint *ep; struct osmo_pfcp_cp_peer *cp_peer; + /* Running counters for the PFCP conn */ + struct osmo_stat_item_group *statg; } pfcp; struct osmo_timer_list hnb_store_rab_durations_timer; diff --git a/include/osmocom/hnbgw/hnbgw_pfcp.h b/include/osmocom/hnbgw/hnbgw_pfcp.h index 585d3f7..376d144 100644 --- a/include/osmocom/hnbgw/hnbgw_pfcp.h +++ b/include/osmocom/hnbgw/hnbgw_pfcp.h @@ -1,3 +1,9 @@ #pragma once +enum hnbgw_upf_stats { + HNBGW_UPF_STAT_ASSOCIATED, +}; +#define HNBGW_UPF_STAT_SET(stat, val) osmo_stat_item_set(osmo_stat_item_group_get_item(g_hnbgw->pfcp.statg, (stat)), (val)) + int hnbgw_pfcp_init(void); +void hnbgw_pfcp_release(void); diff --git a/src/osmo-hnbgw/hnbgw_pfcp.c b/src/osmo-hnbgw/hnbgw_pfcp.c index c7b2b08..dc82f04 100644 --- a/src/osmo-hnbgw/hnbgw_pfcp.c +++ b/src/osmo-hnbgw/hnbgw_pfcp.c @@ -20,12 +20,27 @@ */ #include <osmocom/core/sockaddr_str.h> +#include <osmocom/core/stats.h> +#include <osmocom/core/stat_item.h> #include <osmocom/pfcp/pfcp_endpoint.h> #include <osmocom/pfcp/pfcp_cp_peer.h> #include <osmocom/hnbgw/hnbgw.h> #include <osmocom/hnbgw/context_map.h> #include <osmocom/hnbgw/ps_rab_fsm.h> +#include <osmocom/hnbgw/hnbgw_pfcp.h> + +static const struct osmo_stat_item_desc hnbgw_upf_stat_item_description[] = { + [HNBGW_UPF_STAT_ASSOCIATED] = { "pfcp_associated", "Associated to UPF through PFCP", OSMO_STAT_ITEM_NO_UNIT, 16, 0}, +}; + +static const struct osmo_stat_item_group_desc hnbgw_upf_statg_desc = { + "upf", + "UPF Peer Statistics", + OSMO_STATS_CLASS_PEER, + ARRAY_SIZE(hnbgw_upf_stat_item_description), + hnbgw_upf_stat_item_description, +}; static void pfcp_set_msg_ctx(struct osmo_pfcp_endpoint *ep, struct osmo_pfcp_msg *m, struct osmo_pfcp_msg *req) { @@ -62,6 +77,12 @@ } } +static void pfcp_cp_peer_assoc_cb(struct osmo_pfcp_cp_peer *cp_peer, bool associated) +{ + LOGP(DLPFCP, LOGL_NOTICE, "PFCP Peer associated: %s\n", associated ? "true" : "false"); + HNBGW_UPF_STAT_SET(HNBGW_UPF_STAT_ASSOCIATED, associated ? 1 : 0); +} + int hnbgw_pfcp_init(void) { struct osmo_pfcp_endpoint_cfg cfg; @@ -81,6 +102,12 @@ return -1; } + g_hnbgw->pfcp.statg = osmo_stat_item_group_alloc(g_hnbgw, &hnbgw_upf_statg_desc, 0); + if (!g_hnbgw->pfcp.statg) { + LOGP(DLPFCP, LOGL_ERROR, "Failed creating UPF stats item group\n"); + return -1; + } + cfg = (struct osmo_pfcp_endpoint_cfg){ .set_msg_ctx_cb = pfcp_set_msg_ctx, .rx_msg_cb = pfcp_rx_msg, @@ -136,6 +163,11 @@ LOGP(DLPFCP, LOGL_ERROR, "Cannot allocate PFCP CP Peer FSM\n"); return -1; } + if (osmo_pfcp_cp_peer_set_associated_cb(g_hnbgw->pfcp.cp_peer, pfcp_cp_peer_assoc_cb)) { + LOGP(DLPFCP, LOGL_ERROR, "Cannot Set PFCP CP Peer associated callback\n"); + return -1; + } + if (osmo_pfcp_cp_peer_associate(g_hnbgw->pfcp.cp_peer)) { LOGP(DLPFCP, LOGL_ERROR, "Cannot start PFCP CP Peer FSM\n"); return -1; @@ -143,3 +175,10 @@ return 0; } + +void hnbgw_pfcp_release(void) +{ + if (!hnb_gw_is_gtp_mapping_enabled()) + return; + osmo_stat_item_group_free(g_hnbgw->pfcp.statg); +} diff --git a/src/osmo-hnbgw/osmo_hnbgw_main.c b/src/osmo-hnbgw/osmo_hnbgw_main.c index 3e715b0..2034490 100644 --- a/src/osmo-hnbgw/osmo_hnbgw_main.c +++ b/src/osmo-hnbgw/osmo_hnbgw_main.c @@ -369,5 +369,8 @@ } /* not reached */ +#if ENABLE_PFCP + hnbgw_pfcp_release(); +#endif exit(0); } -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/38616?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ic71df8df83e97f4015077677e426c803f84d31ea Gerrit-Change-Number: 38616 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: statsd: Support f_statsd_snapshot() API when using VTY-triggered stat...
by pespin 04 Nov '24

04 Nov '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38615?usp=email ) Change subject: statsd: Support f_statsd_snapshot() API when using VTY-triggered stats report ...................................................................... statsd: Support f_statsd_snapshot() API when using VTY-triggered stats report Until now that API was only used in testsuites which relied on time-trigerred reports. This commit also supports getting a given snapshots if the IUT is configured to only trigger a report based on VTY request. Change-Id: I87d34e2f365d3b71ce328c08999be43d482326ad --- M library/StatsD_Checker.ttcnpp 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/38615/1 diff --git a/library/StatsD_Checker.ttcnpp b/library/StatsD_Checker.ttcnpp index db5c77b..b2b8332 100644 --- a/library/StatsD_Checker.ttcnpp +++ b/library/StatsD_Checker.ttcnpp @@ -188,6 +188,9 @@ if (not since_last_snapshot) { STATS.clear; } +#ifdef STATSD_HAVE_VTY + f_vty_transceive(STATSVTY, "stats report"); +#endif T_statsd.start; while (seen_remain > 0) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38615?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I87d34e2f365d3b71ce328c08999be43d482326ad Gerrit-Change-Number: 38615 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: global_platform/scp: mapdu may be undeclared
by dexter 04 Nov '24

04 Nov '24
dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38605?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: global_platform/scp: mapdu may be undeclared ...................................................................... global_platform/scp: mapdu may be undeclared when we sign and encrypt the APDU in _wrap_cmd_apdu (SCP03) we return an "mapdu" at the end. However, in the (unlikely?) case where self.do_cencand self.do_cmac are false, mapdu will be undeclared. In _wrap_cmd_apdu for SCP02 we just re-use the apdu variable and return it at the end, so when no encryption and no signing is applied, the APDU falls just through without any modifications. We should have the same mechanism for the SCP03 wrapping as well. Related: OS#6367 Change-Id: Ic7089a69dffd7313572c5b3e5953200be5925766 --- M pySim/global_platform/scp.py 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/pySim/global_platform/scp.py b/pySim/global_platform/scp.py index 2cf8b63..0b1f6a9 100644 --- a/pySim/global_platform/scp.py +++ b/pySim/global_platform/scp.py @@ -508,11 +508,11 @@ # channel number shall be set to zero, bit 4 shall be set to 0 and bit 3 shall be set to 1 to indicate # GlobalPlatform proprietary secure messaging. mcla = (cla & 0xF0) | CLA_SM - mapdu = bytes([mcla, ins, p1, p2, mlc]) + cmd_data - cmac = self.sk.calc_cmac(mapdu) - mapdu += cmac[:self.s_mode] + apdu = bytes([mcla, ins, p1, p2, mlc]) + cmd_data + cmac = self.sk.calc_cmac(apdu) + apdu += cmac[:self.s_mode] - return mapdu + return apdu def unwrap_rsp_apdu(self, sw: bytes, rsp_apdu: bytes) -> bytes: # No R-MAC shall be generated and no protection shall be applied to a response that includes an error -- To view, visit https://gerrit.osmocom.org/c/pysim/+/38605?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ic7089a69dffd7313572c5b3e5953200be5925766 Gerrit-Change-Number: 38605 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in osmo-hnbgw[master]: ps_rab_ass_fsm: Fix uninitialized ptr access
by fixeria 04 Nov '24

04 Nov '24
Attention is currently required from: pespin. fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38614?usp=email ) Change subject: ps_rab_ass_fsm: Fix uninitialized ptr access ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/38614?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ifdcd4c369b35820c5c2beb695392d0b82d4ea34c Gerrit-Change-Number: 38614 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 04 Nov 2024 11:42:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-hnbgw[master]: ps_rab_ass_fsm: Fix uninitialized ptr access
by osmith 04 Nov '24

04 Nov '24
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38614?usp=email ) Change subject: ps_rab_ass_fsm: Fix uninitialized ptr access ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/38614?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ifdcd4c369b35820c5c2beb695392d0b82d4ea34c Gerrit-Change-Number: 38614 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 04 Nov 2024 11:36:58 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-hnbgw[master]: ps_rab_ass_fsm: Fix uninitialized ptr access
by pespin 04 Nov '24

04 Nov '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38614?usp=email ) Change subject: ps_rab_ass_fsm: Fix uninitialized ptr access ...................................................................... ps_rab_ass_fsm: Fix uninitialized ptr access /git/osmo-hnbgw/include/osmocom/hnbgw/context_map.h:211:9: error: 'rab' may be used uninitialized [-Werror=maybe-uninitialized] 211 | _map_rua_dispatch(MAP, EVENT, MSGB, __FILE__, __LINE__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /git/osmo-hnbgw/src/osmo-hnbgw/ps_rab_ass_fsm.c:358:9: note: in expansion of macro 'map_rua_dispatch' 358 | map_rua_dispatch(rab->map, MAP_RUA_EV_TX_DIRECT_TRANSFER, msg); | ^~~~~~~~~~~~~~~~ /git/osmo-hnbgw/src/osmo-hnbgw/ps_rab_ass_fsm.c:297:24: note: 'rab' was declared here 297 | struct ps_rab *rab; | ^~~ Change-Id: Ifdcd4c369b35820c5c2beb695392d0b82d4ea34c --- M src/osmo-hnbgw/ps_rab_ass_fsm.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/14/38614/1 diff --git a/src/osmo-hnbgw/ps_rab_ass_fsm.c b/src/osmo-hnbgw/ps_rab_ass_fsm.c index 456d5aa..f400fcc 100644 --- a/src/osmo-hnbgw/ps_rab_ass_fsm.c +++ b/src/osmo-hnbgw/ps_rab_ass_fsm.c @@ -294,7 +294,7 @@ /* See whether all information is in so that we can forward the modified RAB Assignment Request to RUA. */ static void ps_rab_ass_req_check_local_f_teids(struct ps_rab_ass *rab_ass) { - struct ps_rab *rab; + struct ps_rab *rab = NULL; RANAP_RAB_AssignmentRequestIEs_t *ies = &rab_ass->ranap_rab_ass_req_message->msg.raB_AssignmentRequestIEs; int i; struct msgb *msg; @@ -346,6 +346,12 @@ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_RAB_SetupOrModifyItemFirst, &first); } + if (!rab) { + LOG_PS_RAB_ASS(rab_ass, LOGL_ERROR, "Lookup PS RAB Assignment Request failed\n"); + ps_rab_ass_failure(rab_ass); + return; + } + /* Send the modified RAB Assignment Request to the hNodeB, wait for the RAB Assignment Response */ msg = ranap_rab_ass_req_encode(ies); if (!msg) { -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/38614?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ifdcd4c369b35820c5c2beb695392d0b82d4ea34c Gerrit-Change-Number: 38614 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: pySim-shell-test: improve global platform tests
by dexter 04 Nov '24

04 Nov '24
dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38604?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pySim-shell-test: improve global platform tests ...................................................................... pySim-shell-test: improve global platform tests The tests that check the establishment of a secure channel currently only test security level 3. Also the get_data command after it only tests data reception from the card. Let's extend the test coverage and test the SCP establishment for security level 1 as well. Let's also add a get_status command to make sure sending data to the card also works (without exceptions). Related: OS#6367 Change-Id: Idff40b414a249e532df1bdce2a8deb9b0cb9718f --- M tests/pySim-shell_test/gp/test_est_scp02_csv.script M tests/pySim-shell_test/gp/test_est_scp02_direct.template M tests/pySim-shell_test/gp/test_est_scp03_csv.script M tests/pySim-shell_test/gp/test_est_scp03_direct.template 4 files changed, 27 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/tests/pySim-shell_test/gp/test_est_scp02_csv.script b/tests/pySim-shell_test/gp/test_est_scp02_csv.script index d44cdce..5e07481 100644 --- a/tests/pySim-shell_test/gp/test_est_scp02_csv.script +++ b/tests/pySim-shell_test/gp/test_est_scp02_csv.script @@ -2,6 +2,13 @@ set echo true select ADF.ISD + establish_scp02 --key-provider-suffix 1 --key-ver 112 --security-level 3 get_data issuer_identification_number +get_status isd +release_scp + +establish_scp02 --key-provider-suffix 1 --key-ver 112 --security-level 1 +get_data issuer_identification_number +get_status isd release_scp diff --git a/tests/pySim-shell_test/gp/test_est_scp02_direct.template b/tests/pySim-shell_test/gp/test_est_scp02_direct.template index 60bb9d6..39bca95 100644 --- a/tests/pySim-shell_test/gp/test_est_scp02_direct.template +++ b/tests/pySim-shell_test/gp/test_est_scp02_direct.template @@ -2,7 +2,13 @@ set echo true select ADF.ISD + establish_scp02 --key-dek $KEY_DEK --key-enc $KEY_ENC --key-mac $KEY_MAC --key-ver 112 --security-level 3 get_data issuer_identification_number +get_status isd release_scp +establish_scp02 --key-dek $KEY_DEK --key-enc $KEY_ENC --key-mac $KEY_MAC --key-ver 112 --security-level 1 +get_data issuer_identification_number +get_status isd +release_scp diff --git a/tests/pySim-shell_test/gp/test_est_scp03_csv.script b/tests/pySim-shell_test/gp/test_est_scp03_csv.script index 8c3f2be..2a0b76d 100644 --- a/tests/pySim-shell_test/gp/test_est_scp03_csv.script +++ b/tests/pySim-shell_test/gp/test_est_scp03_csv.script @@ -2,6 +2,13 @@ set echo true select ADF.ISD-R + establish_scp03 --key-provider-suffix 1 --key-ver 50 --security-level 3 get_data issuer_identification_number +get_status isd +release_scp + +establish_scp03 --key-provider-suffix 1 --key-ver 50 --security-level 1 +get_data issuer_identification_number +get_status isd release_scp diff --git a/tests/pySim-shell_test/gp/test_est_scp03_direct.template b/tests/pySim-shell_test/gp/test_est_scp03_direct.template index 70ef0ae..20592df 100644 --- a/tests/pySim-shell_test/gp/test_est_scp03_direct.template +++ b/tests/pySim-shell_test/gp/test_est_scp03_direct.template @@ -2,6 +2,13 @@ set echo true select ADF.ISD-R + establish_scp03 --key-dek $KEY_DEK --key-enc $KEY_ENC --key-mac $KEY_MAC --key-ver 50 --security-level 3 get_data issuer_identification_number +get_status isd +release_scp + +establish_scp03 --key-dek $KEY_DEK --key-enc $KEY_ENC --key-mac $KEY_MAC --key-ver 50 --security-level 3 +get_data issuer_identification_number +get_status isd release_scp -- To view, visit https://gerrit.osmocom.org/c/pysim/+/38604?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Idff40b414a249e532df1bdce2a8deb9b0cb9718f Gerrit-Change-Number: 38604 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.