[S] Change in osmo-mgw[master]: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul()

2023-12-16 Thread laforge
Attention is currently required from: fixeria.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email )

Change subject: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul()
..


Patch Set 1:

(1 comment)

File include/osmocom/mgcp/mgcp_common.h:

https://gerrit.osmocom.org/c/osmo-mgw/+/35321/comment/9f8d970b_c6d1727f 
PS1, Line 86:
the original code looks neoken. if we want to write to tail[0] we actually have 
to use something like msgb_put.



--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4f4b0f792bbeef94a5449c4a5843628a703a3d54
Gerrit-Change-Number: 35321
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sat, 16 Dec 2023 21:55:30 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-mgw[master]: client: safely handle dealloc on event dispatch

2023-12-16 Thread laforge
Attention is currently required from: neels.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/35349?usp=email )

Change subject: client: safely handle dealloc on event dispatch
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35349?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6f1c0f6a26f9cd6993dc1910a44070ec0438e636
Gerrit-Change-Number: 35349
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: neels 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:49:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: rua: validate correct RUA ctx state per RUA message type

2023-12-16 Thread laforge
Attention is currently required from: neels.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/35329?usp=email )

Change subject: rua: validate correct RUA ctx state per RUA message type
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/35329?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ie359fcada98fb19f56015cf462e6d8c039f5fce5
Gerrit-Change-Number: 35329
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: neels 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:49:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmo-netif[master]: osmo_stream_srv_link_ofd_cb(): fix wrong socket size passed to accept()

2023-12-16 Thread laforge
Attention is currently required from: fixeria.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/35332?usp=email )

Change subject: osmo_stream_srv_link_ofd_cb(): fix wrong socket size passed to 
accept()
..


Patch Set 1: Code-Review-2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35332?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ie280c255fb2ba790b448e283439c42b766427352
Gerrit-Change-Number: 35332
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:47:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in pysim[master]: filesystem: fix typo

2023-12-16 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/35352?usp=email )

Change subject: filesystem: fix typo
..

filesystem: fix typo

Change-Id: I721875d302ab69340d56b33102297b56c070465f
---
M pySim/filesystem.py
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 35863a8..0e72921 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -147,7 +147,7 @@
 return inter_path

 """Build the relative sequence of files we need to traverse to get 
from us to 'target'."""
-# special-case handling for selecting MF while we MF is selected
+# special-case handling for selecting MF while the MF is selected
 if target == target.get_mf():
 return [target]
 cur_fqpath = self.fully_qualified_path_fobj()

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35352?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: I721875d302ab69340d56b33102297b56c070465f
Gerrit-Change-Number: 35352
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[M] Change in pysim[master]: runtime: refactor file selection methods select and select_file

2023-12-16 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34932?usp=email )

Change subject: runtime: refactor file selection methods select and select_file
..

runtime: refactor file selection methods select and select_file

The implementation of the methods select and select_file of class
RuntimeLchan is a bit complex. We access the card directly in several
places which makes it difficult to track the state changes. We should
clean this up so that we call self.rs.card.select_adf_by_aid/
self.scc.select_file from a single place only.

This means that the method select uses the method select_file. This
results in a much cleaner implementation. We also should take care
that the important states that we track (selected_file, selected_adf,
etc.) are updated by a single private method. Since the update always
must happen after a select _select_post is a good place to do this.

Related: OS#5418
Change-Id: I9ae213f3b078983f3e6d4c11db38fdbe504c84f2
---
M pySim/runtime.py
1 file changed, 72 insertions(+), 40 deletions(-)

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 1155433..f836ec8 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -255,6 +255,8 @@
 raise ValueError(
 "Cannot select unknown file by name %s, only hexadecimal 4 
digit FID is allowed" % fid)

+self._select_pre(cmd_app)
+
 try:
 # We access the card through the select_file method of the scc 
object.
 # If we succeed, we know that the file exists on the card and we 
may
@@ -264,6 +266,7 @@
 # so we do not have to update any state in that case.
 (data, sw) = self.scc.select_file(fid)
 except SwMatchError as swm:
+self._select_post(cmd_app)
 k = self.interpret_sw(swm.sw_actual)
 if not k:
 raise(swm)
@@ -282,8 +285,8 @@
desc="elementary file, manually added at 
runtime")

 self.selected_file.add_files([f])
-self.selected_file = f
-return select_resp, data
+
+self._select_post(cmd_app, f, data)

 def _select_pre(self, cmd_app):
 # unregister commands of old file
@@ -291,7 +294,17 @@
 for c in self.selected_file.shell_commands:
 cmd_app.unregister_command_set(c)
 
-def _select_post(self, cmd_app):
+def _select_post(self, cmd_app, file:Optional[CardFile] = None, 
select_resp_data = None):
+# we store some reference data (see above) about the currently 
selected file.
+# This data must be updated after every select.
+if file:
+self.selected_file = file
+if isinstance(file, CardADF):
+self.selected_adf = file
+if select_resp_data:
+self.selected_file_fcp_hex = select_resp_data
+self.selected_file_fcp = 
self.selected_file.decode_select_response(select_resp_data)
+
 # register commands of new file
 if cmd_app and self.selected_file.shell_commands:
 for c in self.selected_file.shell_commands:
@@ -308,22 +321,31 @@
 inter_path = self.selected_file.build_select_path_to(file)
 if not inter_path:
 raise RuntimeError('Cannot determine path from %s to %s' % 
(self.selected_file, file))
-
 self._select_pre(cmd_app)

-for p in inter_path:
+# be sure the variables that we pass to _select_post contain valid 
values.
+selected_file = self.selected_file
+data = self.selected_file_fcp_hex
+
+for f in inter_path:
 try:
-if isinstance(p, CardADF):
-(data, sw) = self.rs.card.select_adf_by_aid(p.aid, 
scc=self.scc)
-self.selected_adf = p
+# We now directly accessing the card to perform the selection. 
This
+# will change the state of the card, so we must take care to 
update
+# the local state (lchan) as well. This is done in the method
+# _select_post. It should be noted that the caller must always 
use
+# the methods select_file or select. The caller must not 
access the
+# card directly since this would lead into an incoherence of 
the
+# card state and the state of the lchan.
+if isinstance(f, CardADF):
+(data, sw) = self.rs.card.select_adf_by_aid(f.aid, 
scc=self.scc)
 else:
-(data, sw) = self.scc.select_file(p.fid)
-self.selected_file = p
+(data, sw) = self.scc.select_file(f.fid)
+selected_file = f
 except SwMatchError as swm:
-

[S] Change in pysim[master]: filesystem: use sort path when selecting an application

2023-12-16 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/35351?usp=email )

Change subject: filesystem: use sort path when selecting an application
..

filesystem: use sort path when selecting an application

The method build_select_path_to uses the internal file system tree model
to find the path to a given file. This works the same for applications
(ADF) as it works for normal files (EF/DF). However, an application can
be selected anytime from any location in the filesystem tree. There is
no need to select a specific path leading to that application first.
This means that if there is an ADF somewhere in the resulting
inter_path, we may clip everything before that ADF.

Related: OS#5418
Change-Id: I838a99bb47afc73b4274baecb04fff31abf7b2e2
---
M pySim/filesystem.py
1 file changed, 29 insertions(+), 1 deletion(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index d39162c..35863a8 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -136,6 +136,16 @@
 return ret

 def build_select_path_to(self, target: 'CardFile') -> 
Optional[List['CardFile']]:
+
+# special-case handling for applications. Applications may be selected
+# any time from any location. If there is an ADF somewhere in the path,
+# we may clip everything before that ADF.
+def clip_path(inter_path):
+for i in reversed(range(0, len(inter_path))):
+if isinstance(inter_path[i], CardADF):
+return inter_path[i:]
+return inter_path
+
 """Build the relative sequence of files we need to traverse to get 
from us to 'target'."""
 # special-case handling for selecting MF while we MF is selected
 if target == target.get_mf():
@@ -152,7 +162,7 @@
 for te2 in target_fqpath[i+1:]:
 inter_path.append(te2)
 # we found our common ancestor
-return inter_path[1:]
+return clip_path(inter_path[1:])
 return None

 def get_mf(self) -> Optional['CardMF']:

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35351?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: I838a99bb47afc73b4274baecb04fff31abf7b2e2
Gerrit-Change-Number: 35351
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[S] Change in pysim[master]: filesystem: use sort path when selecting an application

2023-12-16 Thread laforge
Attention is currently required from: dexter.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/35351?usp=email )

Change subject: filesystem: use sort path when selecting an application
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35351?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: I838a99bb47afc73b4274baecb04fff31abf7b2e2
Gerrit-Change-Number: 35351
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:45:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in pysim[master]: runtime: refactor file selection methods select and select_file

2023-12-16 Thread laforge
Attention is currently required from: dexter, fixeria.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34932?usp=email )

Change subject: runtime: refactor file selection methods select and select_file
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34932?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: I9ae213f3b078983f3e6d4c11db38fdbe504c84f2
Gerrit-Change-Number: 34932
Gerrit-PatchSet: 5
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:45:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in pysim[master]: filesystem: fix typo

2023-12-16 Thread laforge
Attention is currently required from: dexter.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/35352?usp=email )

Change subject: filesystem: fix typo
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35352?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: I721875d302ab69340d56b33102297b56c070465f
Gerrit-Change-Number: 35352
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:44:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: GTP_Emulation: SGSN_ContextRequest: Fix unconditional access to optio...

2023-12-16 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35375?usp=email )

Change subject: GTP_Emulation: SGSN_ContextRequest: Fix unconditional access to 
optional field IMSI
..

GTP_Emulation: SGSN_ContextRequest: Fix unconditional access to optional field 
IMSI

Change-Id: I254f790aeb7c491200b86bec3c22ae56c452c2df
---
M library/GTP_Emulation.ttcn
1 file changed, 14 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve




diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn
index 4ea293c..6297c4f 100644
--- a/library/GTP_Emulation.ttcn
+++ b/library/GTP_Emulation.ttcn
@@ -136,7 +136,11 @@
} else if (ischosen(gtp.gtpc_pdu.sgsn_ContextRequest)) {
return gtp.gtpc_pdu.sgsn_ContextRequest.imsi.digits;
} else if (ischosen(gtp.gtpc_pdu.sgsn_ContextResponse)) {
-   return gtp.gtpc_pdu.sgsn_ContextResponse.imsi.digits;
+   if (ispresent(gtp.gtpc_pdu.sgsn_ContextResponse.imsi.digits)) {
+   return gtp.gtpc_pdu.sgsn_ContextResponse.imsi.digits;
+   } else {
+   return omit;
+   }
} else if (ischosen(gtp.gtpc_pdu.forwardRelocationRequest)) {
return gtp.gtpc_pdu.forwardRelocationRequest.imsi.digits;
} else if (ischosen(gtp.gtpc_pdu.relocationCancelRequest)) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35375?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: I254f790aeb7c491200b86bec3c22ae56c452c2df
Gerrit-Change-Number: 35375
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: S1AP_Emulation: Fix NAS_PDU decoding of InitialContextSetupRequest msg

2023-12-16 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35376?usp=email )

Change subject: S1AP_Emulation: Fix NAS_PDU decoding of 
InitialContextSetupRequest msg
..

S1AP_Emulation: Fix NAS_PDU decoding of InitialContextSetupRequest msg

The InitialContextSetupRequest message contains a NAS_PDU deep inside
(in E-RABToBeSetupListCtxtSUReq), and it was not being rx_counted nor
decoded by the S1AP_Emulation.
Since we also care about the lower layer contents from the emulation
user point of view, first send the S1AP_PDU and later the decoded NAS_PDU.
This way the user can wait to receive the related low level S1AP_PDU,
and then read again from the port to get the decoded NAS_PDU.

Change-Id: Ibff5a38b92deafa8d104801f107ca1b8b82bbce0
---
M library/S1AP_Emulation.ttcn
1 file changed, 36 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve




diff --git a/library/S1AP_Emulation.ttcn b/library/S1AP_Emulation.ttcn
index bb3a2a4..9f36225 100644
--- a/library/S1AP_Emulation.ttcn
+++ b/library/S1AP_Emulation.ttcn
@@ -503,6 +503,11 @@
if (match(nas, 
tr_NAS_EMM_SecurityProtected)) {
nas := 
f_nas_try_decaps(S1apAssociationTable[assoc_id].nus, nas);
}
+   /* DL/UlNasTransport are not 
interesting, don't send them */
+   if (not match(mrf.msg, 
(tr_S1AP_DlNasTransport, tr_S1AP_UlNasTransport))) {
+   /* send raw S1AP */
+   
S1AP_CLIENT.send(mrf.msg) to vc_conn;
+   }
/* send decoded NAS */
S1AP_CLIENT.send(nas) to 
vc_conn;
} else {
@@ -771,7 +776,7 @@

 function f_S1AP_get_NAS_PDU(S1AP_PDU s1ap) return template (omit) NAS_PDU
 {
-   var integer i;
+   var integer i, j;

if (ischosen(s1ap.initiatingMessage)) {
var InitiatingMessage im := s1ap.initiatingMessage;
@@ -792,6 +797,19 @@
}
}
}
+   case (tr_S1AP_IntialCtxSetupReq) {
+   var InitialContextSetupRequest msg := 
im.value_.initialContextSetupRequest;
+   for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
+   if (msg.protocolIEs[i].id == 
id_E_RABToBeSetupListCtxtSUReq) {
+   var E_RABToBeSetupListCtxtSUReq rab_req 
:= msg.protocolIEs[i].value_.E_RABToBeSetupListCtxtSUReq;
+   for (j := 0; j < lengthof(rab_req); j 
:= j+1) {
+   var E_RABToBeSetupItemCtxtSUReq 
it := rab_req[j].value_.E_RABToBeSetupItemCtxtSUReq;
+   return it.nAS_PDU;
+   }
+   }
+   }
+   return omit;
+   }
}
}
return omit;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35376?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: Ibff5a38b92deafa8d104801f107ca1b8b82bbce0
Gerrit-Change-Number: 35376
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: LTE_CryptoFunctions.ttcn: Increment nus.rx_count on each pkt read

2023-12-16 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35366?usp=email )

Change subject: LTE_CryptoFunctions.ttcn: Increment nus.rx_count on each pkt 
read
..

LTE_CryptoFunctions.ttcn: Increment nus.rx_count on each pkt read

Before this patch, the rx_count field was never set to anything other
than zero.

There's still a problem with counter not being incremented when a
S1AP_IntialCtxSetupReq message containing a NAS_PDU is received. This
will be fixed ina follow-up patch.

Change-Id: I1ee25fd8fde6fbce95444ee4b73918ce1f61b427
---
M mme/LTE_CryptoFunctions.ttcn
1 file changed, 24 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/mme/LTE_CryptoFunctions.ttcn b/mme/LTE_CryptoFunctions.ttcn
index 9923541..340b784 100644
--- a/mme/LTE_CryptoFunctions.ttcn
+++ b/mme/LTE_CryptoFunctions.ttcn
@@ -143,6 +143,12 @@
var octetstring data_with_seq := int2oct(secp_nas.sequenceNumber, 1) & 
secp_nas.nAS_Message;
var OCT4 exp_mac := f_nas_mac_calc(nus.alg_int, nus.k_nas_int, 
nus.rx_count, 0,
   f_rx_is_downlink(nus), 
data_with_seq);
+
+   if (nus.rx_count != secp_nas.sequenceNumber) {
+   setverdict(fail, "Received NAS SeqNr ", secp_nas.sequenceNumber,
+  " doesn't match expected SeqNr ", nus.rx_count, ": 
", secp_nas, " | nus: ", nus);
+   return false;
+   }
if (exp_mac != secp_nas.messageAuthenticationCode) {
setverdict(fail, "Received NAS MAC ", 
secp_nas.messageAuthenticationCode,
   " doesn't match expected MAC ", exp_mac, ": ", 
secp_nas, " | nus: ", nus);
@@ -173,12 +179,14 @@
return dec_PDU_NAS_EPS(secp_nas.nAS_Message);
}
case ('0001'B) { /* IP only */
+   nus.rx_count := nus.rx_count + 1;
if (not f_nas_check_ip(nus, secp_nas)) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
"f_nas_check_ip() failed");
}
return dec_PDU_NAS_EPS(secp_nas.nAS_Message);
}
case ('0010'B) { /* IP + ciphered */
+   nus.rx_count := nus.rx_count + 1;
if (not f_nas_check_ip(nus, secp_nas)) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
"f_nas_check_ip() failed");
}

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35366?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: I1ee25fd8fde6fbce95444ee4b73918ce1f61b427
Gerrit-Change-Number: 35366
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: S1AP_Emulation: Fix NAS_PDU decoding of InitialContextSetupRequest msg

2023-12-16 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35376?usp=email )

Change subject: S1AP_Emulation: Fix NAS_PDU decoding of 
InitialContextSetupRequest msg
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35376?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: Ibff5a38b92deafa8d104801f107ca1b8b82bbce0
Gerrit-Change-Number: 35376
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:43:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: LTE_CryptoFunctions.ttcn: Increment nus.rx_count on each pkt read

2023-12-16 Thread laforge
Attention is currently required from: osmith, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35366?usp=email )

Change subject: LTE_CryptoFunctions.ttcn: Increment nus.rx_count on each pkt 
read
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35366?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: I1ee25fd8fde6fbce95444ee4b73918ce1f61b427
Gerrit-Change-Number: 35366
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:43:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: GTP_Emulation: SGSN_ContextRequest: Fix unconditional access to optio...

2023-12-16 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35375?usp=email )

Change subject: GTP_Emulation: SGSN_ContextRequest: Fix unconditional access to 
optional field IMSI
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35375?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: I254f790aeb7c491200b86bec3c22ae56c452c2df
Gerrit-Change-Number: 35375
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Sat, 16 Dec 2023 19:43:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment