Commit Graph

13 Commits

Author SHA1 Message Date
Max 753c15de2f Migrate from OpenSSL to osmo_get_rand_id()
This avoids potential licensing incompatibility and makes integration of
Debian packaging patches easier.

Related: OS#1694
Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336
2017-12-27 11:11:14 +00:00
Neels Hofmeyr 2ef2da54ab cosmetic prep: tell vlr_ops.set_ciph_mode() whether UMTS AKA is used
In case of UMTS AKA, the Kc for ciphering must be derived from the 3G auth
tokens. tuple->vec.kc was calculated from the GSM algorithm and is not
necessarily a match for the UMTS AKA tokens.

To decide (in an upcoming patch) whether to use UMTS AKA derived Kc or the Kc
from the auth vector, the set_ciph_mode() from vlr_ops needs to know whether
UMTS AKA is being used. This could possibly derived from the msc_conn_ref, but
all flags are already available in the vlr_lu_fsm and vlr_access_req_fsm. Hence
add a umts_aka flag to the set_ciph_mode() callback invocation. The VLR FSMs
thus decide whether UMTS AKA or GSM AKA is to be used during Ciphering Mode
Command, which makes more sense than re-implementing the same decision process
in the MSC.

I considered placing the Kc derivation in vlr_set_ciph_mode() and only tell the
MSC's set_ciph_mode() implementation the precise keys it should use, but the
RAN particulars, and whether a Kc is used at all, rather belong with the MSC.

Related: OS#2745
Prepares: If04e405426c55a81341747a9b450a69188525d5c
Change-Id: I983c48347faf4ee1b405d8174b4e006c904157cf
2017-12-18 05:18:11 +01:00
Neels Hofmeyr e3d72d7827 cosmetic prep: publish vlr_use_umts_aka() decision
During Set Ciphering Mode on GERAN, it is required to know whether UMTS AKA is
used to decide which Kc to pick. Change static function is_umts_auth() into
public vlr_use_umts_aka(), so future patches can re-use it.

Prepares: If04e405426c55a81341747a9b450a69188525d5c
Change-Id: I85d784c62ecbabdb6186a3dae4dcd554e7921041
2017-12-18 05:18:11 +01:00
Neels Hofmeyr 4cf4fddf28 vlr: debug log: log Ciphering Mode details
Change-Id: Ib19dfd7255bda01ebace62386df4ec89697d9d14
2017-12-18 03:48:24 +01:00
Neels Hofmeyr 3bae836310 vlr_subscr_conn_timeout(): don't fire events to discarded fi
Terminating one of the FSM instances may effect termination and deallocation of
the others, as well as the vlr_subscr itself. So, reserve the vlr_subscr
locally, and then dispatch events to exactly those FSM instances that exist.

The changes in expected output in the msc_vlr_tests shows that the subscriber
was deallocated from the first FSM termination, and now sticks around until
we've checked both FSMs are gone.

Change-Id: I56551ecc10f5295fe75944bdde4b583b1b621811
2017-11-20 13:49:32 +00:00
Neels Hofmeyr b3fa355321 vlr_gsupc_read_cb: fix use after free of GSUP msgb
osmo_gsup_decode() doesn't actually decode everything, it does leave quite a
number of pointers into the original msgb. Hence we must not deallocate the
gsup msgb before dispatching GSUP events.

Move msgb_free() to the bottom of vlr_gsupc_read_cb() and use rc and gotos to
early-exit if needed.

Change-Id: I16fc92dcf84e29fcf34712a2e8b0464ef08425ad
2017-11-20 13:49:32 +00:00
Neels Hofmeyr 0b8dec70a2 defaults: assign TMSI by default
When using ciphering, the TMSI is an important part of the ciphering. To guard
against users forgetting to set 'assign tmsi' in the config and compromising
their ciphering unknowingly, the default should be to use a TMSI.

To optimize in an unencrypted network, 'no assign tmsi' config can still switch
off TMSI use.

Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e
2017-10-31 02:02:44 +01:00
Neels Hofmeyr 834f94a2cb fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free()
Add required msgb_free() to vlr_gsupc_read_cb().

Adjust msc_vlr_tests.c gsup_rx() to *not* free the msgb again after
vlr_gsupc_read_cb() did.

Related: OS#2476
Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0
2017-10-03 20:30:17 +00:00
Max 43b01b0514 Remove rest_octets.h
The MSC should not fiddle with low-level SI details like rest octets
anyway. Unfortunately simply removing the header is impossible as it
causes massive fallout due to missing includes. Fixed it as well.

The only other parameter which required removal is cell_ro_sel_par which
is not referenced anywhere in the code anyway.

Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354
2017-09-15 11:31:03 +02:00
Neels Hofmeyr 9084396467 rename include/openbsc to include/osmocom/msc
Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9
2017-09-06 16:41:25 +02:00
Neels Hofmeyr bac227653a split off osmo-msc: remove files, apply build, rename
Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7
2017-08-29 12:51:19 +00:00
Neels Hofmeyr 84da6b1edb Implement IuCS (large refactoring and addition)
osmo-nitb becomes osmo-msc
add DIUCS debug log constant
add iucs.[hc]
add msc vty, remove nitb vty
add libiudummy, to avoid linking Iu deps in tests
Use new msc_tx_dtap() instead of gsm0808_submit_dtap()
libmgcp: add mgcpgw client API
bridge calls via mgcpgw

Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to
be split up.

Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-08-08 19:17:53 +02:00
Harald Welte b8b85a1b2e Add libvlr implementation
Original libvlr code is by Harald Welte <laforge@gnumonks.org>,
polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

This is a long series of trial-and-error development collapsed in one patch.
This may be split in smaller commits if reviewers prefer that. If we can keep
it as one, we have saved ourselves the additional separation work.

Related: OS#1592
Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
2017-07-21 18:32:03 +02:00