aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
AgeCommit message (Collapse)AuthorFilesLines
2016-04-27debug log for paging: add/tweakNeels Hofmeyr1-5/+2
2016-04-25paging_signal_data: remove unused lac memberNeels Hofmeyr1-1/+0
2016-04-25paging response: remove extraneous null check, assert conn and msg further upNeels Hofmeyr1-1/+4
In handle_paging_response(), don't check conn against NULL after using it all the time anyway. To ensure beyond doubt that it is actually never NULL, assert conn further up in the call stack, i.e. in gsm0408_dispatch(), the main entry point for receiving data from the BSC/RNC level. Also assert msg while at it. Fixes: CID#93769
2016-04-20add preliminary paging response handling, incompleteNeels Hofmeyr2-19/+45
In gsm_04_08.c, add a static handle_paging_resp() to take over from the libbsc function gsm48_handle_paging_resp(). Use the subscr->requests listing to handle a Paging Response and call the pending cbfn. In NITB, this used to be done via BTS, and I haven't entirely resolved yet how exactly to rewire this in standalone libmsc. So far, this "works for me", but is worth another visit. Still missing: enable Integrity Protection.
2016-04-20gsm_04_08.c: fix security mode cmd: use auth tuple from MM authNeels Hofmeyr1-12/+2
2016-04-20cosmetic: auth tuple memcpy: rather use target's sizeof()Neels Hofmeyr1-3/+3
2016-04-20tweak tmp_rand[] type to avoid compiler warningsNeels Hofmeyr1-2/+2
2016-04-20IuCS auth: generate auth tuples, factor outNeels Hofmeyr1-11/+32
Factor out hardcoded-Ki and auth tuple creation into a static function. Add generation of fresh random bytes and generate a valid auth tuple so that the authentication token is different for every MM Auth.
2016-04-20cscn: enable 'subscriber' vty commands for libmscNeels Hofmeyr1-1/+0
This involves removing the openbsc_vty_print_statistics() from vty_interface_layer3.c, as this would link across the MSC/BSC border.
2016-04-20cosmetic: debug and error logging, comment tweaksNeels Hofmeyr3-1/+12
2016-04-20Add Iu pagingNeels Hofmeyr1-3/+10
Add iu_page_cs() and iu_page_ps() API, also add to libiudummy for linking in tests. Implement msc_paging_request() by calling iu_page_cs().
2016-04-19libmsc: Pass KeyStatus to iu_tx_sec_mode_cmdDaniel Willmann1-1/+1
2016-04-11cscn: record and use LAC on incoming InitialUE msgNeels Hofmeyr1-6/+30
Add lac argument to gsm0408_rcvmsg_iucs(), to record the LAC in newly allocated gsm_subscriber_connections. In effect, fix the LAC sent to UE during Location Updating Accept message. Before, 0 was stored as LAC and sent to the UE, regardless of the actual LAC in use.
2016-04-05vty l3 help: fix typo 'comamnds'; fix english s/his//Neels Hofmeyr1-5/+5
2016-03-31cosmetic: comments, debug log, msgb alloc nameNeels Hofmeyr1-3/+3
2016-03-31mscsplit: rewire MSC gsm0808_submit_dtap() to msc_tx_dtap()Neels Hofmeyr4-19/+15
2016-03-31Merge branch 'master' into sysmocom/iuNeels Hofmeyr1-7/+26
Conflicts: openbsc/src/libmsc/auth.c openbsc/src/libmsc/gsm_04_08.c openbsc/src/osmo-bsc/osmo_bsc_vty.c openbsc/tests/Makefile.am
2016-03-31Fix MM Auth: zero-initialize auth tuple before first useNeels Hofmeyr1-1/+10
Make sure a new auth tuple is initialized after db_get_lastauthtuple_for_subscr() returns an error, i.e. if no tuple is present for the subscriber yet. Before this patch, the first key_seq depended on the typically uninitialized value that was present in auth tuple's key_seq upon calling auth_get_tuple_for_subscr(). The very first key_seq used for a new subscriber will now always be 0. Before, it used to be mostly 1 ("(0 + 1) % 7"), but depended on whether the key_seq was indeed initialized with 0, actually by random.
2016-03-31Fix MM Auth: disallow key_seq mismatchNeels Hofmeyr1-0/+1
In auth_get_tuple_for_subscr(), add missing condition to match incoming key_seq with stored key_seq, so that re-authentication is requested for mismatching key_seqs. Add test for this issue.
2016-03-31MM Auth: return AUTH_NOT_AVAIL instead of hardcoded zeroNeels Hofmeyr1-4/+4
AUTH_NOT_AVAIL == 0, so this is no functional change.
2016-03-31MM Auth: introduce AUTH_ERROR constant.Neels Hofmeyr1-3/+3
Instead of using hardcoded -1 for errors, include -1 in the enum auth_action type; apply its use. In the mm_auth test, the string output changes from '(internal error)' to 'AUTH_ERROR', since now the proper enum value is used in auth_action_names[].
2016-03-31Add MM Auth test; add auth_action_str() functionNeels Hofmeyr1-0/+9
Add basic MM Authentication test setup, with fake DB access and RAND_bytes(). So far implement simple tests for IO error during DB access and missing auth entry. To print the auth action during tests, add struct auth_action_names and auth_action_str() inline function in auth.[hc].
2016-03-22comments about incomplete MM cipheringNeels Hofmeyr1-0/+5
2016-03-22cscn: implement integrity protectionNeels Hofmeyr2-4/+27
Upon authentication response, initiate integrity protection for Iu by sending a Security Mode Command (IK), with hardcoded auth tuple so far. Implement RANAP event handling to receive Security Mode Complete message, adding stubs for the other events; in new files osmo-cscn/iucs_ranap.[hc] to keep RANAP dependencies separate, and particularly out of libmsc. Upon receiving Security Mode Complete, call the security operation callback (conn->sec_operation->cb) to complete the Location Update. Introduce enum integrity_protection_state constants to indicate integrity protection, record in gsm_subscriber_conn.iu.integrity_protection. Make subscr_conn_lookup_iu() non-static and declare in iu_cs.h to be able to call from iucs_ranap.c's Security Mode Complete event. Implement dummy iu_tx_sec_mode_cmd() to allow tests to build without RANAP dependencies. In cscn_main.c, call iucs_rx_ranap_event(), to populate the struct gsm_network struct with cscn_network explicitly (don't share cscn_network across compilation scopes because it's ugly).
2016-03-22in gsm8_rx_mm_auth_resp(): call sec_operation.cb() instead of finish_lu() ↵Neels Hofmeyr1-9/+7
directly
2016-03-22fix various compiler warningsNeels Hofmeyr1-0/+1
sgsn_libgtp.c: missing include, for asn1str_to_u32() iu_cs.c: missing include, for subscr_name() osmo_bsc_vty.c: int/pointer conversions (note: this was discussed on the list to be solved by passing a pointer instead. Until then...) iudummy.c: opaque struct declarations
2016-03-22gsm0408_authorize(): remove unused msgb arg, make non-staticNeels Hofmeyr1-3/+3
Prepares for calling from IuCS RANAP events.
2016-03-22cosmetic: whitespace, comment, rename static func rx_iu_event()Neels Hofmeyr2-1/+3
2016-03-21debug log fixesNeels Hofmeyr1-1/+2
gprs_gmm.c: remove extraneous debug print arg. iu_cs.c: increment should not be in debug statement. Fixes at least one coverity warning.
2016-03-18debug: log list of subscribers upon lookupNeels Hofmeyr1-0/+36
2016-03-18IuCS: fix logical flip in same_ue_conn()Neels Hofmeyr1-1/+1
2016-03-17Revert "move to hex TMSI representation"Harald Welte1-8/+7
This reverts commit 044fbe6568f82a12bf4e3addc7e3d6db529b6548.
2016-03-17move to hex TMSI representationVadim Yanitskiy1-7/+8
In OpenBSC, we traditionally displayed a TMSI in its integer representation, which is quite unusual in the telecom world. A TMSI is normally printed as a series of 8 hex digits. This patch aligns OpenBSC with the telecom industry standard. Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2016-03-17fix confusing typo in constant (THAN -> THEN)Neels Hofmeyr2-2/+2
2016-03-1504.08: apply new transaction id inline functionsNeels Hofmeyr2-2/+2
libosmocore recently added inline functions to relieve callers from applying bitmasks and bit shifts to access the transaction id of a GSM 04.08 header. Apply these functions.
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr2-8/+8
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2016-03-1504.08: apply new transaction id inline functionsNeels Hofmeyr2-2/+2
libosmocore recently added inline functions to relieve callers from applying bitmasks and bit shifts to access the transaction id of a GSM 04.08 header. Apply these functions.
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr2-6/+7
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2016-03-15cosmetic: commentsNeels Hofmeyr2-2/+2
2016-03-14msc: allow only authentication without cipheringNeels Hofmeyr1-4/+14
So far the code did only auth+ciph or none. Add case handling for only authentication without ciphering (basically just fill in the blanks).
2016-03-14HACK: hardcode subscriber auth tuple for IuCSNeels Hofmeyr1-0/+12
2016-03-14cosmeticNeels Hofmeyr2-4/+2
2016-03-14Adjust authentication logic for Iu, move a log noticeNeels Hofmeyr2-6/+27
Depending on conn->via_iface, fail upon missing auth for 3G. Move the log notice saying "skipping auth" to gsm48_secure_channel() where conn->via_iface is actually known.
2016-03-14spread a few debug logs around authenticationNeels Hofmeyr1-7/+43
2016-03-14fix confusing typo in constant (THAN -> THEN)Neels Hofmeyr2-2/+2
2016-03-14Remove unused auth code and add commentNeels Hofmeyr1-4/+13
As commented in the code, the GSM_SECURITY_AUTH_FAILED path is never invoked by the gsm48_secure_channel() function as it is today. Note that the upcoming Iu auth will probably add a GSM_SECURITY_AUTH_FAILED status. In that case, sending a LU Reject immediately may be desirable, but arguably a bit of timeout could make life harder for auth attackers. The code removed by this patch doesn't send out a LU Reject ever, since a call to release_loc_updating_req() only releases the connection. To reject, a call to gsm0408_loc_upd_rej() would be necessary, as seen in loc_upd_rej_cb(). And finally, if _gsm0408_authorize_sec_cb() doesn't do anything about anything, the same loc_upd_rej_cb() will be run by a timeout and send a LU Reject properly (as commented in the code).
2016-03-04move two gsm0480_send_*() to xsc as gsm0480_gen_*()Neels Hofmeyr1-22/+2
Have two separate gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() for each of libbsc and libmsc. Move their core into libxsc as generator functions returning a msgb. Add src/libbsc/gsm_04_80_utils.c (note, not 04_08) to implement the libbsc side of it. The code is identical, but the linked structs and functions differ in each case. There could be a common source file built for both, but I decided against it, for more clarity I hope.
2016-03-04fix two minor Makefile.am errorsNeels Hofmeyr1-1/+1
2016-03-04move sms_next_rp_msg_ref() to libxsc, for gsm0408testNeels Hofmeyr2-38/+1
Also change the signature to avoid using gsm_subscriber_connection, which has different members in libbsc and libmsc.
2016-03-04rename nitb vty config to cscn, move to cscn_vty.cNeels Hofmeyr3-68/+101