aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/auth.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-09Merge branch 'master' into sysmocom/iu, with tweakssysmocom/iu_orig_historyNeels Hofmeyr1-4/+4
Numerous manual adjustments are included to make sense on the sysmocom/iu branch: * gsm_04_08_gprs.h has moved to libosmocore on the master branch, but sysmocom/iu has added some entries. Until it is clear whether to move the additions to libosmocore as well, keep gsm_04_08_gprs.h on sysmocom/iu with merely the additions. * Thus, keep using the old gsm_04_08_gprs.[hc] from openbsc in the Makefiles, but only where the sysmocom/iu additions are needed. * In openbsc's gsm_04_08_gprs.h, * include the libosmocore gsm_04_08_gprs.h, * use '#pragma once' instead of #ifndef and * add a TODO comment about moving the rest to libosmocore. * Apply the addition of an osmo_auth_vector to gsm_auth_tuple: in the Iu auth vector hacks, use the gsm_auth_tuple.vec instead of a local struct. See iu_hack__get_hardcoded_auth_tuple() and gsm48_rx_gmm_att_req(). * In the si2q tests, pass NULL as ctx to gsm_network_init(). * In cscn_main.c, add a debug log that was originally added to osmo-nitb. * openbsc/.gitignore: keep only one addition of 'writtenconfig' Conflicts: openbsc/include/openbsc/gprs_sgsn.h openbsc/include/openbsc/gsm_04_08_gprs.h openbsc/src/gprs/gsm_04_08_gprs.c openbsc/src/libmsc/gsm_04_08.c openbsc/src/osmo-cscn/cscn_main.c openbsc/tests/gsm0408/Makefile.am
2016-04-29Start to use struct osmo_auth_vector from gsm_auth_tupleHarald Welte1-4/+4
Rather than having a 'private' structure for kc, sres and rand, we now finally (with 4 years delay) use osmo_auth_vector from libosmogsm, which encapsulates authentication vectors that can be either GSM triplets or UMTS quintuples or a combination of both. gsm_auth_tuple becomes a wrapper around osmo_auth_vector, adding use_count and key_seq to it. key_seq is no longer initialized inside gprs_gsup_messages.c, as there is no CKSN / key_seq inside the message anyway. If a usre of the code needs key_seq, they need to manage it themselves.
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-22cosmetic: whitespace, comment, rename static func rx_iu_event()Neels Hofmeyr1-0/+2
2016-03-17fix confusing typo in constant (THAN -> THEN)Neels Hofmeyr1-1/+1
2016-03-14Adjust authentication logic for Iu, move a log noticeNeels Hofmeyr1-2/+0
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-14fix confusing typo in constant (THAN -> THEN)Neels Hofmeyr1-1/+1
2015-10-12libmsc: Use RAND_bytes to choose auth tupleDaniel Willmann1-3/+8
[hfreyther: Fix compiler warning about unused variable]
2011-05-07src: use namespace prefix osmo_* for misc utilsPablo Neira Ayuso1-2/+2
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-1/+1
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-0/+132
... and make sure tests work again after restructuring