pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40443?usp=email )
Change subject: NGAP_Emulation: Fix match on DownlinkNASTransport with different list of IEs
......................................................................
NGAP_Emulation: Fix match on DownlinkNASTransport with different list of IEs
The existing receive templates match only a given set of parameters.
Some of them are optional, so they wouldn't match the template if added.
Match based on procedureCode instead.
Change-Id: Iaec861f8c0d55a2897896d695b9f70bca64af339
---
M library/NGAP_Emulation.ttcn
M library/NGAP_Functions.ttcn
2 files changed, 21 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/43/40443/1
diff --git a/library/NGAP_Emulation.ttcn b/library/NGAP_Emulation.ttcn
index 1dcae70..178d6cd 100644
--- a/library/NGAP_Emulation.ttcn
+++ b/library/NGAP_Emulation.ttcn
@@ -426,6 +426,11 @@
mw_ngap_unsuccMsg({procedureCode := tr_NGAP_ProcedureCode_non_UErelated,
criticality := ?,
value_ := ?}));
+template (present) NGAP_PDU
+tr_NGAP_DownlinkNASTransport := mw_ngap_initMsg({procedureCode := id_DownlinkNASTransport,
+ criticality := ?,
+ value_ := { DownlinkNASTransport := ? }
+ });
function main(NGAPOps ops, NGAP_conn_parameters p, charstring id) runs on NGAP_Emulation_CT {
var Result res;
@@ -557,7 +562,7 @@
dl_nas := f_NG_NAS_try_decaps_dl(NGapAssociationTable[assoc_id].nus, dl_nas);
}
/* DL/UlNasTransport are not interesting, don't send them */
- if (not match(mrf.msg, mw_ngap_initMsg(mw_n2_DownlinkNASTransport))) {
+ if (not match(mrf.msg, tr_NGAP_DownlinkNASTransport)) {
/* send raw NGAP */
NGAP_CLIENT.send(mrf.msg) to vc_conn;
}
diff --git a/library/NGAP_Functions.ttcn b/library/NGAP_Functions.ttcn
index 70d8941..523754e 100644
--- a/library/NGAP_Functions.ttcn
+++ b/library/NGAP_Functions.ttcn
@@ -21,18 +21,18 @@
{
if (ischosen(ngap.initiatingMessage)) {
var InitiatingMessage im := ngap.initiatingMessage;
- select (im) {
- case (mw_n2_DownlinkNASTransport) {
+ select (im.procedureCode) {
+ case (id_DownlinkNASTransport) {
return im.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
}
- case (mw_n2_UEContextReleaseCommand) {
+ case (id_UEContextRelease) {
return im.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_NGAP_IDs.uE_NGAP_ID_pair.aMF_UE_NGAP_ID;
}
/* TODO */
}
} else if (ischosen(ngap.successfulOutcome)) {
var SuccessfulOutcome so := ngap.successfulOutcome;
- select (so) {
+ select (so.procedureCode) {
case (?) {
return omit;
/* TODO */
@@ -42,7 +42,7 @@
}
} else if (ischosen(ngap.unsuccessfulOutcome)) {
var UnsuccessfulOutcome uo := ngap.unsuccessfulOutcome;
- select (uo) {
+ select (uo.procedureCode) {
case (?) {
return omit;
/* TODO */
@@ -58,21 +58,21 @@
{
if (ischosen(ngap.initiatingMessage)) {
var InitiatingMessage im := ngap.initiatingMessage;
- select (im) {
- case (mw_n2_initialUeMessage) {
+ select (im.procedureCode) {
+ case (id_InitialUEMessage) {
return im.value_.InitialUEMessage.protocolIEs[0].value_.RAN_UE_NGAP_ID;
}
- case (mw_n2_DownlinkNASTransport) {
+ case (id_DownlinkNASTransport) {
return im.value_.downlinkNASTransport.protocolIEs[1].value_.RAN_UE_NGAP_ID;
}
- case (mw_n2_UEContextReleaseCommand) {
+ case (id_UEContextRelease) {
return im.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_NGAP_IDs.uE_NGAP_ID_pair.rAN_UE_NGAP_ID;
}
/* TODO */
}
} else if (ischosen(ngap.successfulOutcome)) {
var SuccessfulOutcome so := ngap.successfulOutcome;
- select (so) {
+ select (so.procedureCode) {
case (?) {
return omit;
/* TODO */
@@ -82,7 +82,7 @@
}
} else if (ischosen(ngap.unsuccessfulOutcome)) {
var UnsuccessfulOutcome uo := ngap.unsuccessfulOutcome;
- select (uo) {
+ select (uo.procedureCode) {
case (?) {
return omit;
/* TODO */
@@ -100,8 +100,8 @@
if (ischosen(ngap.initiatingMessage)) {
var InitiatingMessage im := ngap.initiatingMessage;
- select (im) {
- case (mw_n2_DownlinkNASTransport) {
+ select (im.procedureCode) {
+ case (id_DownlinkNASTransport) {
var DownlinkNASTransport msg := im.value_.DownlinkNASTransport;
for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
if (msg.protocolIEs[i].id == id_NAS_PDU) {
@@ -109,7 +109,7 @@
}
}
}
- case (mw_n2_UplinkNASTransport) {
+ case (id_UplinkNASTransport) {
var UplinkNASTransport msg := im.value_.UplinkNASTransport;
for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
if (msg.protocolIEs[i].id == id_NAS_PDU) {
@@ -117,7 +117,7 @@
}
}
}
- case (mw_n2_initialUeMessage) {
+ case (id_InitialUEMessage) {
var InitialUEMessage msg := im.value_.InitialUEMessage;
for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
if (msg.protocolIEs[i].id == id_NAS_PDU) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40443?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: Iaec861f8c0d55a2897896d695b9f70bca64af339
Gerrit-Change-Number: 40443
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, pespin.
jolly has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440?usp=email )
Change subject: 5gc: Implement NAS integrity check of DL messages
......................................................................
Patch Set 7:
(1 comment)
File library/NG_CryptoFunctions.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440/comment/c4076863_fb3a… :
PS6, Line 264: make compiler happy about not returning
> does `mtc.stop` really make compiler happy? […]
The C++ compiler also complains later:
NG_CryptoFunctions.cc:3683:1: warning: control reaches end of non-void function [-Wreturn-type]
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I118081af10f260513734550854c3a1751e32cbb4
Gerrit-Change-Number: 40440
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 06 Jun 2025 11:52:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, jolly.
Hello Jenkins Builder, fixeria, jolly,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Verified+1 by Jenkins Builder
Change subject: 5gc: Implement NAS integrity check of DL messages
......................................................................
5gc: Implement NAS integrity check of DL messages
Change-Id: I118081af10f260513734550854c3a1751e32cbb4
---
M 5gc/C5G_Tests.ttcn
M 5gc/gen_links.sh
M 5gc/regen_makefile.sh
M deps/Makefile
M library/LTE_CryptoFunctions.ttcn
M library/NGAP_Emulation.ttcn
M library/NG_CryptoFunctionDefs.cc
M library/NG_CryptoFunctions.ttcn
M library/NG_NAS_Osmo_Templates.ttcn
M library/ng_crypto/key_derivation.c
M library/ng_crypto/key_derivation.h
11 files changed, 540 insertions(+), 38 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/40/40440/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I118081af10f260513734550854c3a1751e32cbb4
Gerrit-Change-Number: 40440
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, jolly.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440?usp=email )
Change subject: 5gc: Implement NAS integrity check of DL messages
......................................................................
Patch Set 6:
(5 comments)
File 5gc/C5G_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440/comment/05bc2722_e209… :
PS6, Line 44: NG_NAS_Osmo_Templates
> duplicate, check above
Acknowledged
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440/comment/5f99b440_44b1… :
PS6, Line 91: "192.168.123.50"
> idea: can probably be calculated from `imsi_suffix`?
tbh I'm not even using it for now, and may be removed at some later point Not relevant to the steps I'm doing now, and I'm not really changing it in this commit.
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440/comment/18206188_a115… :
PS6, Line 310: abba
> I hear "ABBA - Dancing Queen" in my head when reading this :D […]
Indeed. That's supposed to be always 0x00000 in current release, so not really interesting.
File library/NG_CryptoFunctions.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440/comment/86d02e99_c0ba… :
PS6, Line 175: if (nus.role == NG_NAS_ROLE_UE) {
: return true;
: } else {
: return false;
: }
> `return nus. […]
I just kept it the same as in LTE_CryptoFunctions.ttcn.
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440/comment/235c02e3_80ae… :
PS6, Line 264: make compiler happy about not returning
> does `mtc.stop` really make compiler happy? […]
Yes, but afaik ttcn3 doesn't have a way to tell the compiler that a function is not expected to ever return. Hence, the compiler only sees the flow returning from f_shutdown() and nothing being returned.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40440?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I118081af10f260513734550854c3a1751e32cbb4
Gerrit-Change-Number: 40440
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 06 Jun 2025 11:16:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/40441?usp=email )
Change subject: jobs: make references to master branch consistent
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/40441?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I7389585165bf3a790c7a338d10f5f7fe2311ee69
Gerrit-Change-Number: 40441
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 06 Jun 2025 11:08:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes