Commit Graph

7034 Commits

Author SHA1 Message Date
Pau Espin 3a02d29804 Announce IuFP audio codec for UTRAN conns in CRCX towards MGW
This way the MGW knows it has to handle IuUP in that connection (answer
IuUP Initialization, etc.).

Depends: osmo-mgw.git 1de5ed6f979bd4c1380789c9a82f8e396f05c5f8
Change-Id: I7aca671e00ed27ac03f0d106b5a6b665a9bed4c1
2022-01-05 13:58:15 +01:00
Oliver Smith 2ee27f9e06 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I1b68e0aa26d81fbfe26abaa287d2bd5eec2cfd0f
2021-12-14 12:18:16 +01:00
Alexander Couzens e400b1161d ran_msg_iu: do not pass UEA0 to ranap_new_msg_sec_mod_cmd2()
On the protocol level, it's impossible to indicate UEA0 together
with the other algorithms.  The encryption is either a) disabled,
so the Encryption Information IE is not present, or b) enabled,
so the Encryption Information IE indicates UEA1 and/or UEA2.

Because of that, the ranap_new_msg_sec_mod_cmd2() would fail to
generate the RANAP PDU if the given bitmask has the UEA0 bit set.

Fixes: 505a94a610 ("Make UTRAN encryption algorithms configurable")
Change-Id: I3271d27c09fc8d70a912bce998ceffbce64dd95e
2021-12-09 13:42:28 +00:00
Vadim Yanitskiy c44342b88c libmsc: fix memory leak (struct msgb) in msc_i_ran_enc()
Function msc_i_ran_enc() calls msc_role_ran_encode(), but unlike the
other callers of this function it does not free() the encoded message.

A simple solution would be to call msgb_free(), like it's done in
the other places.  But a more elegant solution is to modify function
msc_role_ran_encode(), so that it attaches the msgb to OTC_SELECT.
This way there is no need to call msgb_free() here and there.

This change fixes a memleak observed while running ttcn3-msc-test.

Change-Id: I741e082badc32ba9a97c1495c894e1d22e122e3a
Related: OS#5340
2021-12-07 18:43:00 +03:00
Vadim Yanitskiy d405bad32d libmsc: ran_iu_make_security_mode_command(): clarify UIA mask
Change-Id: I7535d5ede5b22c61575a16d15927598e6137392a
2021-12-02 04:47:04 +03:00
Vadim Yanitskiy 35db146e88 libmsc: ran_iu_make_security_mode_command(): improve readability
Change-Id: I14f4f9617f91ed17fb7614f218cb023a0231866d
2021-11-30 13:14:16 +00:00
Vadim Yanitskiy 565ea2ba0c libvlr: fix is_ciph_required(): always send SecModeCmd for UTRAN
Ciphering is optional in both GERAN and UTRAN, however for the later
it's *required* to enable integrity protection for the signalling.
Thus we must always send Security Mode Command in UTRAN, even in
case if ciphering is disabled (UEA0) in the configuration.

The actual decision whether to send CMC/SMC or not is taken in:

  * vlr_access_req_fsm.c / _proc_arq_vlr_node2(), and
  * vlr_lu_fsm.c / vlr_loc_upd_post_auth().

depending on the value returned by is_ciph_required().  Let's
rename this function to is_cmc_smc_required() and ensure that
it always returns true in UTRAN.

This change fixes the Iu test cases in ttcn3-msc-test.

Change-Id: I6205f13453eff7afbf25e013d72ae98a78fcd31b
Fixes: OS#5333
2021-11-30 13:14:16 +00:00
Vadim Yanitskiy f4b87fa83c libvlr: vlr_set_ciph_mode(): avoid redundant check
This function is never called when ciph_required is false, so
there is no need for an additional check in this function.

Change-Id: I900ddd5f1882f8cee234ab1074adcf25830a092c
2021-11-30 09:53:47 +00:00
Vadim Yanitskiy 6d594e4e83 libmsc: fix another memleak (struct gsm_sms) in gsm340_rx_tpdu()
Change-Id: I42e819fb83096c1432df16f501b9d1f6a6160ae7
Fixes: I2c50904349dd4ed229b60b8468d776b817c0bd44
2021-11-29 20:36:35 +00:00
Vadim Yanitskiy ef19fc1ccd libmsc: fix memory leak (struct gsm_sms) in gsm340_rx_tpdu()
If a MO SMS gets successfully routed through SMPP, we return early
in gsm340_rx_tpdu() and leak a chunk of type 'struct gsm_sms'.

Change-Id: I8a745d747f06baa7109418ffe600b27b3c0a5228
Fixes: [1] Ic34d398e0a850856e20380ae35e5c2ae5e3c539b
Fixes: OS#5334
2021-11-29 20:36:35 +00:00
Vadim Yanitskiy 9a28230ef2 VTY: clarify deprecation message for cfg_net_per_loc_upd_cmd
Change-Id: I95636a7713cd90956e46a5b6f8f7ded3bf4f5f0a
2021-11-28 03:44:28 +03:00
Alexander Couzens 2c5e46104e libmsc/gsm_04_08: refactor require ciphering into an own function
Make it more readable.

Change-Id: I9e407f65b282e645feabe714f7f4c3e44fae21e9
2021-11-27 04:39:34 +01:00
Alexander Couzens 8b7d78588a utran: use new UTRAN encryption enum
Depends: libosmocore.git I4b9baff2c2fbd0e339fc769cc69cce58d3a72cdf
Change-Id: If6978d7ed1a78facc2591cfc30fda2721629bffa
2021-11-17 20:18:52 +00:00
Pau Espin b7f97ea8a0 Bump version: 1.7.0.43-aefbf-dirty → 1.8.0
Change-Id: I37aa63e1c4ed021c5cc8b186f073cf01ab9a9cb6
2021-11-16 17:44:54 +01:00
Vadim Yanitskiy aefbf7a829 Do not mention deprecated -l / --database options
Change-Id: I47fe7e64126710db34c49f48ea9e8f8d46662e4b
2021-11-12 20:28:08 +03:00
Vadim Yanitskiy 1ec8e54317 Do not mention deprecated -M / --mncc-sock-path options
Change-Id: I34387f561446aa5bf5db5264f0aca6bf6469d0e5
2021-11-12 20:26:17 +03:00
Vadim Yanitskiy 3caede7498 manuals: remove deprecated -C / --no-dbcounter options
Change-Id: I0a7bc537ed84c5f3e203d106893b1cf1ee8b599a
2021-11-12 19:12:41 +03:00
Alexander Couzens 2aaff7513b Validate the choosen UTRAN encryption algorithm
RANAP Security Command can include an encryption IE. If it includes
it the RNC can still ignore it (e.g. unsupported encryption) and
return the Security Command Complete with an choosen encryption IE:
"no encryption".
Validate the encryption element and ensure the encryption is included in
the encryption mask.

Closes: OS#4144
Change-Id: Icfc135c8b8ae862defe7114db492af600c26407f
2021-11-05 01:29:05 +01:00
Harald Welte 505a94a610 Make UTRAN encryption algorithms configurable
Allow the user fine-grained control over which UMTS encryption
algorithms are permitted, rather than always permitting UEA1 and UEA2
or neither.

This brings the handling of UEA in line with the handling of A5 for
GERAN.

Change-Id: I91f9e50f9c1439aa19528f887b83ae9de628fcfd
Closes: OS#4144
Depends: osmo-iuh.git I6d2d033b0427bdc84fee61e0f3cb7b29935214bf
2021-11-05 01:29:05 +01:00
Harald Welte 274b70f1a8 Fix enabling of UMTS UEA encryption
The existing code allowed the user to configure UMTS encryption in the
vty, but we never actually passed this information down to RANAP.  As a
result, the RAN had no chance of ever enabling encryption on the air
interface.

Change-Id: Ieaaa6b23b7337b7edb902fad8031e195e0c5e9d2
Related: OS#4144
2021-11-05 01:29:05 +01:00
Oliver Smith efa6c5b7d6 Revert "Turn some compiler warnings into errors"
Do not turn some compiler warnings into errors by default. This patch
was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

This reverts commit 34f012639d.

Related: OS#5289
Change-Id: Ideff462157a034e053e5e7049605dd8d24440905
2021-11-04 13:03:20 +00:00
Vadim Yanitskiy c6921e5068 mncc: rework passing GCR over the MNCC interface
Using *unpacked* 'struct osmo_gcr_parsed' in the MNCC PDUs makes
the protocol even more complicated than it currently is, and
moreover complicates implementing MNCCv8 in the ttcn3-sip-test.

Replace 'struct osmo_gcr_parsed' in 'struct gsm_mncc' with a
fixed-length buffer, which is supposed to hold the Global Call
Reference encoded as per 3GPP TS 29.205.

Indicate presence of GCR using the MNCC_F_GCR flag.

Change-Id: I259b6d7e4cbe26159b9b496356fc7c1c27d54521
Fixes: I705c860e51637b4537cad65a330ecbaaca96dd5b
Related: OS#5164, OS#5282
2021-11-03 21:12:52 +00:00
Vadim Yanitskiy e0661105ac smpp_smsc: use osmo_talloc_replace_string() in smpp_smsc_conf()
Change-Id: Ie3dc0d9673a0410a5908cba77fc352d581bac6f6
Fixes: CID#240711
2021-10-30 02:27:21 +00:00
Vadim Yanitskiy 97b8e76b50 libmsc: struct smsc: drop 'const' qualifier from bind_addr
This pointer holds an address of a string allocated on heap.

Change-Id: I50145b57494aaccd4793f7b0ed2f65a6641db929
Related: CID#240711
2021-10-26 18:42:57 +00:00
Vadim Yanitskiy 583883bf2e libmsc: fix NULL pointer dereference in trans_lcls_compose()
Change-Id: I96342de4cb3e0bc3d3cac7538d4517aa211e8a38
Fixes: CID#240768
2021-10-26 10:25:39 +03:00
Keith Whyte a1a70be593 Add support for LCLS to the MSC
This commit is largely based on work by
Max <msuraev@sysmocom.de>

Adds LCLS parameters for A-interface transactions
This commit also adds a vty option to facilitate globally
disabling LCLS for all calls on this MSC.

Add a global call reference (GCR) to MNCC and therefore
bump the MNCC version to version 8. (This commit has to be
merged at the same time as the corresponing commit in the
osmo-sip-connector for mncc-external use.)

Depends: osmo-sip-connector Id40d7e0fed9356f801b3627c118150055e7232b1
Change-Id: I705c860e51637b4537cad65a330ecbaaca96dd5b
2021-10-25 10:07:48 +00:00
Harald Welte 890ece1277 smpp_mirror: Don't allocate msgb's for unrealistic amounts of memory
If the remote ESME would send us 0xffffffff as length field, don't try
to allocte 4GB of memory, but bail out.

Change-Id: I561f75210811826de06ea1673eca1df24faaa210
Fixes: CID#240738
2021-10-25 09:58:51 +00:00
Harald Welte 065b23ae5b smpp_mirror: Factor-out reset of SMPP read state
Change-Id: Ib9f210316eaddae19cb74db92b922016864dd786
2021-10-25 08:20:00 +02:00
Harald Welte 30811f865c smpp: Fix help string in vty for "alert-notifications"
Without the 'no' prefix, this command is about enabling, not disabling

Change-Id: I3019a0d9271e73030b9d7cd555761e17358ec812
2021-09-28 21:40:40 +02:00
Oliver Smith 4ac59538e9 contrib/osmo-msc.spec.in: require libosmo-ranap >= 0.7.0
Sync with configure.ac, debian/control. Nowadays osmo-release.sh
complains about this.

Related: I8dbbd63fdbd35f5f90f20dcd7e710078f2d9e12a
Change-Id: Ib3b9d6af8f9d4e807ff4106f95f0a5b13834a126
2021-09-16 14:34:18 +02:00
Philipp Maier ce1f973283 msc_vlr_test: remove DLMGCP log messages from unit test output
The log output of libosmo-mgcp-client has changed. This change causes
the unit tests to fail because the log output does not match anymore.
Lets disable the DLMGCP log output since it is of minor importance
for VLR testing anyway.

Change-Id: Id197e4ab9ba12e284299ef520edee9c362513bf1
Related: SYS#5091
2021-09-14 12:06:45 +02:00
Pau Espin 35ff852379 cosmetic: Fix typo in comment
Change-Id: Ic167bb4e12c657f917ad4f76ef65f46753c5f7a5
2021-08-25 12:40:36 +02:00
Pau Espin 017ba1fa30 vlr_sgs: Balance use_count incremented in vlr_sgs_loc_update
During a recent pcap trace, it was spotted that subscriber coming from
SGs had a use count with 16 "SGs" items, and later it incremented to 17.
Further investigation shows that the related use_count item was never
decreased, meaning every time an SGs-LU was sent by the MME, the item
was incremented further and never decremented.

Let's rename the item to be referenced while in LU, and then decremented
when LU is done. At that time, either the LU was accepted and the
subscriber object has a use_count item "attached", or it was rejected
and we already sent the reject messages, so we are fine deleting it if
needed.

Related: SYS#5337
Change-Id: I22c386f02ffa57428f700b003cc2cf23133598d0
2021-08-24 14:59:27 +02:00
Pau Espin 25b3ffb5f4 vlr_sgs.c: Fix missing use_count decrease in vlr_sgs_imsi_detach
it was recently observed in a pcap trace with gsmtap_log that the
use_count contained a "vlr_sgs_imsi_detach" item despite no related
message was seen near by. Further investigation shows that there's an
unbalanced get+put code path, introduced by an early return added to fix
another issue.

related: SYS#5337
Fixes: 0803d88d9a
Change-Id: I91ae956e50fca2f4d0e1d145d60ccb0ebfb409e9
2021-08-24 14:59:12 +02:00
Pau Espin eb1b3ab6da vlr_auth_fsm.c: Simplify function auth_fsm_wait_ai_resync
Change-Id: I2070002dea18b728deef5547b4deb6166cfcab6a
2021-08-24 12:25:40 +02:00
Pau Espin 13f17c13c3 vlr_sgs.h: Set proper logic order of items in enum sgs_ue_fsm_state
Set order of states in the same order as they appear in the specs (see
chapter 4.2.2 mentioned above the enum).
Furthermore, from FSM state transition point of view it also makes sense
to put them in this new order, since one should pass through
SGS_UE_ST_LA_UPD_PRES to get to SGS_UE_ST_ASSOCIATED.

Change-Id: Ia9216965e9f30caedffa3cb53d14da7f7fd37b4e
2021-08-24 11:49:05 +02:00
Pau Espin 25b6847f46 cosmetic: fix typos in comments
Change-Id: I89e8eba379f83bcf3061601b02af9f10dbca0f22
2021-08-24 11:42:15 +02:00
Philipp Maier 945b0606cf running.adoc: add section about MGCP configuration
The manual seems to lack a section about how the MGW is set up. In the
osmo-bsc manual we have a "Configure MGCP to connect to an MGW" section
under the "Configure primary links" section. We should have the same
thing in the osmo-msc manual as well.

Change-Id: I5501739e63860c436ff606bc2758b495258cd2b9
Depends: osmo-mgw I47e7ff858d5067b46d52329be5f362ff61c0dff8
2021-08-03 11:36:25 +02:00
Neels Hofmeyr ae98b97382 implement CM Re-Establish for voice calls
Related: SYS#5130
Change-Id: I6fa37d6ca9fcb1637742b40e37b68d67664c9b60
2021-07-29 22:40:59 +02:00
Neels Hofmeyr 5bdba0d48d add vlr_subscr_find_by_mi
Will be used by I6fa37d6ca9fcb1637742b40e37b68d67664c9b60
"implement CM Re-Establish for voice calls"

Related: SYS#5130
Change-Id: I5291d098a02268bd1c2e30195ae61e4a13e8709c
2021-07-28 18:37:48 +02:00
Neels Hofmeyr 0c076bc75a add sequence_charts/call_reestablishment.msc
Change-Id: I6ebc3a0555ef82e1c027ca75b45f8147a3e07ee6
2021-07-28 18:37:48 +02:00
Pau Espin e53ecde83e msc_a.c: Allow MSC_A_EV_CN_CLOSE in state MSC_A_ST_RELEASING
As seen in a running osmo-msc:
"vlr_access_req_fsm.c:153
msc_a(IMSI-....:MSISDN-...:TMSI-0x...:GERAN-A-8:CM_SERVICE_REQ){MSC_A_ST_RELEASING}:
Event MSC_A_EV_CN_CLOSE not permitted"

Also seen in several unit tests, which need update.

The action event handler for that state is actually already
expecting/handling the event by ignoring it, so we should allow it.

Change-Id: I4d30cffab693529aab3ba736419dec116a4dd7ef
2021-07-12 16:37:24 +02:00
Pau Espin 42ac3665c8 sgs_iface.c: Improve logging when paging over SGs
Change-Id: I745d3e904583ddf170ec1a1ceac5a49b72e813e3
2021-07-12 16:37:19 +02:00
Pau Espin 1086e20754 vlr_sgs: Drop recorded LastEutranPlmnId when UE no longer associated
Change-Id: I0dcb1850ab4f6f7d42bfcb19665ddeae2d3b057a
2021-07-02 21:46:49 +02:00
Pau Espin 8252959b74 sgs: Use available API to set vlr subscr LastUsedEutranPLMNId
This way it's easier to find out where the vlr subscriber field is set.

Change-Id: I203de82accc896c196cb70037af89be6dc826c05
2021-07-01 18:14:39 +02:00
Neels Hofmeyr 73d093a806 improve logging on encryption, for Ciphering and HO
log the algorithm and all keys instead of just Kc.

Change-Id: If7871dedda2b1fb115e6f00da1379ff2e3d68a10
2021-06-24 01:44:20 +02:00
Neels Hofmeyr db07fdcbfc support A5/4 in inter-BSC handover
Forward the Kc128 key to the new BSS in BSSMAP Handover Request.

Depends: Ieb6e43eef9e57281d54d4b7c63664668df5aef3e (libosmocore)
Change-Id: Id5ce995a741c8e469a50a0c46e53c06a2378bb7e
2021-06-24 01:44:17 +02:00
Neels Hofmeyr 6ce2edcac1 support A5/4 in Cipher Mode Command
Related: SYS#5324
Change-Id: I780a739b9bfbefd4f58be051794fe1a491823e67
2021-06-24 01:27:47 +02:00
Eric Wild a7f8020bfa vty: allow A5/4 encryption in config
Add A5/4 to the internal mask of allowed algorithms.

(Not actually working yet, A5/4 implementation follows in other
patches.)

Related: SYS#5324
Change-Id: I5b46aaa8579f8d069ca39caf996a8795ffe63dd7
2021-06-24 01:27:47 +02:00
Neels Hofmeyr cdcfc80176 ran_msg_a.c: use gsm0808_create_cipher2()
Use new API in Cipher Mode Command to prepare for A5/4 support.

Depends: Ib3906085e0c6e5a496a9f755f0f786238a86ca34 (libosmocore)
Related: SYS#5324
Change-Id: Ib238d367b8d5d07b6ab4cb2e48fbf4ce22ca4476
2021-06-23 23:58:59 +02:00