Commit Graph

502 Commits

Author SHA1 Message Date
Harald Welte b239862e6a Port to new libosmogsm 'struct osmo_sub_auth_data2'
libosmogsm has recently introdcued a 'struct osmo_sub_auth_data2' as
successor to 'struct osmo_sub_auth_data', together with updated
osmo_auth_gen_vec2/osmo_auth_gen_vec_auts2 API.

The rationale of this new API is to enable
* support for AKA algorithms which use K and/or OP[c] values of 256bit
  (instead of the classic 128bit)
* support for RES length sizes of 4 and 16 bytes (instead of the classic
  8 bytes)

This commit just jumps over to the new API without adding any related
functionality to osmo-hlr.  The latter is left for subsequent commits.

Change-Id: I3207c7bfb73e9ff5471e5c26b66639549e4d48a2
Depends: libosmocore.git Ie775fedba4a3fa12314c0f7c8a369662ef6a40df
2023-06-03 19:35:54 +02:00
Harald Welte 91150802f8 cosmetic: gen_ts_55_205_test_sets/main_template tabs istead of spaces
Let's consistently use our normal tab indent style

Change-Id: I4172b59131ac4166174c1860fcb07b7bee3df728
2023-06-03 19:32:44 +02:00
Harald Welte 8f3fa656e7 cosmetic: gen_ts_55_205_test_sets/func_template.c: Use tab-indent
This templates is used for generating C code, so it should use our
normal tab-based code indenting.

Change-Id: I0be7eb2d7b551d7eaaee15994ef37262694819f6
2023-06-03 19:29:46 +02:00
Harald Welte 829713a69d Introduce support for XOR-2G algorithm
So far we supported a "xor" algorithm in osmo-hlr, without specifying
whether it's the XOR-3G or the (different) XOR-2G algorithm.

Furthermore, it was buggy in the sense that it permitted the XOR[-3G]
for 2G authentication data in the database.

This patch
* renames existing "xor" to "xor-3g"
* disallows "xor-3g" usage with 2G authentication data
* introduces support for XOR-2G as "xor-2g" in the VTY

Change-Id: I039a1f84fda54a908a82fe621e7fd078cb85e4c6
Depends: libosmocore.git I0ee0565382c1e4515d44ff9b1752685c0a66ae39
2023-05-30 21:43:14 +02:00
Oliver Smith 5edf387353 systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: I29e547242b2ed1cfc4750c7d7e5f8636c2e8f3dc
2023-05-26 14:10:45 +02:00
Alexander Couzens 2989873a68 hlr: use talloc for memory allocation in osmo_gsup_create_insert_subscriber_data_msg
Don't use static buffers for APN and MSISDN.
When encoding multiple APNs the static buffer might be too small.
In prepration to support multiple APNs in subscriber data

Change-Id: I00b5c2dfadcf6e0740e93b4c3292d2654d22e80c
2023-05-10 07:58:57 +00:00
Oliver Smith 390f6fcf13 debian: set compat level to 10
Related: OS#5958
Change-Id: I5d26ab03aacf3b8ef8c1c4c669c12090fd0b7899
2023-04-25 16:48:22 +02:00
Vadim Yanitskiy d10c2ef366 tests/*/Makefile.am: move -I to AM_CPPFLAGS
Change-Id: I654053e11b0cc824c198f68e4ff0a0fcb295efb0
2023-03-14 20:11:45 +00:00
Vadim Yanitskiy 974aed9c04 tests/auc/Makefile.am: put object files to LDADD
Change-Id: Iaefcfe7a8904841a29094fe40eb5850912544b4c
2023-03-14 20:11:45 +00:00
Pau Espin cf535dbcbd mslookup: Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: I26bba0dd092ad5fd6b4959b173fae93b542a93f1
2023-03-14 11:42:24 +01:00
Oliver Smith a55e63b087 tests/db/db_test.err: adjust to XOR-3G rename
Adjust the test to the related libosmocore change.

Related: libosmocore I446e54d0ddf4a18c46ee022b1249af73552e3ce1
Change-Id: I68878d24340659f888e5e348b937161cffbd54e2
2023-02-22 16:58:57 +01:00
Oliver Smith 62e5c1b2c7 Run struct_endianness.py
Ensure there is no diff to prepare to run this in CI.

Related: OS#5884
Change-Id: I4294a18871214b70cef267fcaaaaada42cb61bf9
2023-02-20 10:48:57 +01:00
Pau Espin ed939154f8 Bump version: 1.5.0.19-268a-dirty → 1.6.0
Change-Id: Ide480a902bbfadefa396f3a0cb925f5dceab4f9c
2023-02-07 16:49:15 +01:00
Alexander Couzens 268a33e58b Add vty `reject-cause` to set the reject cause
Allow to set the LU reject cause independently for both of the
following cases; either when an IMSI is unknown to the HLR or
when the mslookup client does not a receive a timely response
to a GSUP request for the remote home HLR.

Original patchset modified by <keith@rhizomatica.org>

Change-Id: Icea39020c23fbbea9e92847df76af8986fdbf48a
2023-01-20 14:03:01 +00:00
Neels Hofmeyr 8804a2335a fix memleak of proxy_subscr_listentry
Patch-by: whytek
Related: OS#5854
Change-Id: Ic1ec4911fa5ae91cc75aa865c8201edd83af41ed
2023-01-15 22:45:31 +01:00
Keith Whyte c27bc90ae6 Vty: Fixup config shown/written from vty
This commit fixes the following errors:
Missing timeout param for mslookup.
Fails to start reading a written config if an msc node
is configured in the mslookup server.
Places the individual msc node services in the
top-level wildcard node due to incorrect indentation.

* Add missing timeout param.
* Add missing "ipa-name" part to mslookup-server-msc section.
* Add one extra space indentation for msc services.

This commit also adds a DEFINE for the default timeout value.

Change-Id: Ibb60e74a0803f05f37ac13ca529d77b4cb736025
2022-12-27 17:03:08 +00:00
Oliver Smith f80ab768d0 osmo_mdns_rfc_record/question_encode: remove ctx
Remove the ctx argument to both functions, as it's not used anymore.

Related: OS#5821
Change-Id: I5e3dd18bf08f7aa42f49c262e13250778ea0c6a2
2022-12-23 13:51:28 +01:00
Oliver Smith 5decd49713 mslookup: use apn functions from libosmocore
Use the apn functions from libosmocore to encode and decode qnames to
avoid code duplication and to avoid unnecessary dynamic allocation.

The unit tests for encoding and decoding rfc_question / rfc_record are
still passing and have the same output.

Fixes: OS#5821
Change-Id: I09d3c617fd6eb4075084ee106d3f3c5803861d2f
2022-12-23 13:51:22 +01:00
Oliver Smith c5f034b13d osmo_mdns_rfc_record_decode: proper free on err
Free the whole talloc tree of ret if we can't allocate memory for
ret->rdata.

Related: OS#5821
Change-Id: Iefc89e3c75a4bf4ffee3871c7b551a2a608f7d5f
2022-12-23 13:38:19 +01:00
Oliver Smith 01155eaee6 osmo_mdns_rfc_record_decode: check ret of talloc
Related: OS#5821
Change-Id: Icd0f54a8eb80ca50976f248e017f6e5c727385f3
2022-12-23 13:38:15 +01:00
arehbein e4143234c8 osmo-hlr: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: I5cee719a9c4437712915f0f9760d606f6ec2dd43
2022-12-23 11:13:19 +00:00
Max 6263cf350a ctrl: take both address and port from vty config
Change-Id: Iecae15333a4e77b38d9bce8c8e591af3d5fcf347
2022-12-17 20:59:00 +03:00
Harald Welte 63eefabdde Add -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition
... if --enable-werror is used

Change-Id: Id465254bf12eb84acb116c86711a5b52b4d3ad35
2022-11-03 12:56:24 +01:00
Harald Welte 7a4765325d Support building with -Werror=strict-prototypes / -Werror=old-style-definition
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that
uses constructs of earlier C standards, which were abandoned in C99.

See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.

Change-Id: I861be39275b40c522c02f553074c5a4489e87127
2022-11-03 12:56:24 +01:00
Max 53f6067e97 hlr_vty.c: fix typo
Change-Id: If79ebd9a8998e64be55e52af43e426f37e3972af
2022-09-24 01:55:46 +00:00
Max 8023d246f2 Debian: install osmo-hlr-dgsm.cfg as example config
Related: OS#4107
Change-Id: Ia64f14ada006acb31c5f725dfa0d52f482d3e8b4
2022-09-18 20:19:42 +07:00
Max 00aea9e0d9 systemd: enable basic hardening
This ensures that systemd will not allow us to modify
/home, /root and /run/user which we shouldn't be doing anyway.
See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
for details.

It should also should silence corresponding lintian warning.

Related: OS#4107
Change-Id: Ida5f13bdb9e5bd956c440a381d94eecc18f0b2ef
2022-09-18 19:23:52 +07:00
Max 023c6524a2 Debian: reformat package description
Shorten the lines of package description to comply with
Debian Policy Manual section 3.4.1

Related: OS#4107
Change-Id: Id6bbfc0b013f0e8da80af76206d3ac7fd6b6b0d4
2022-09-18 19:23:52 +07:00
Max 1d02b51a68 Debian: bump copyright year to match current
Related: OS#4107
Change-Id: I581e62b5410a9dddc6b5fd974081d633cc20416d
2022-09-18 19:23:23 +07:00
Max 78a9f92fda Ignore .deb build byproducts
Change-Id: Id36f55cd55be25f764c2b9515eff84d106bab1dc
2022-09-09 22:08:35 +07:00
Max ad8866e86e Set working directory in systemd service file
By default systemd will execute service with root directory (or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system
instance) instead.

Related: OS#4821
Change-Id: I40b5d50470cb55ca94af5e17f21658181a02d4c2
2022-08-29 19:45:03 +07:00
Vadim Yanitskiy 6156950634 db_auc: hexparse_stmt(): check value returned by osmo_hexparse()
Change-Id: I78bb3aff9dd57a38278bb34113ea764e0a54c439
Fixes: CID#272997
2022-06-29 11:30:12 +00:00
Pau Espin 65f51535d0 Bump version: 1.4.0.16-3863-dirty → 1.5.0
Change-Id: I016ddf4fd955c3b518e620a35f9a817f489e81c4
2022-06-28 18:38:31 +02:00
Pau Espin 386381662c doc: Document new subscriber CTRL commands
Related: SYS#5993
Change-Id: I3e38d067bbc2ebb7f788dc56a5d56e1e4cafdc9c
2022-06-21 10:35:40 +02:00
Pau Espin 777860ddb5 ctrl: Introduce CTRL command subscriber.by-*.aud3g <algo[,KI,(op|opc),OP_C[,ind_bitlen]]>
This command provides getter and setter to set and retrieve the
authentication data for 3g subscribers.

Change-Id: Ibe7aeec3cabab0406eb7a84ecd24e529ef1696c2
Related: SYS#5993
2022-06-21 10:35:40 +02:00
Pau Espin 1d0a030aa4 ctrl: Introduce CTRL command subscriber.by-*.aud2g <algo[,ki]>
This command provides getter and setter to set and retrieve the
authentication data for 2g subscribers.

Change-Id: Ibebac232fa173bce8a075cacf477214d5bdb590f
Related: SYS#5993
2022-06-21 10:35:18 +02:00
Pau Espin 3ca9a1fd4f ctrl: Introduce cmd SET subscriber.delete <imsi>
On success SET_REPLY contains the ID of the deleted subscriber.

Related: SYS#5993
Change-Id: I24c6149d7c223a12549d712a7929666220c0210f
2022-06-20 18:05:36 +02:00
Pau Espin b74769f1b4 cosmetic: hlr_vty_subscr.c: Fix trailing whitespace
Change-Id: Id751d227a52f39e3a8874d8b78c633b8d3eb9e74
2022-06-20 18:05:36 +02:00
Pau Espin 140dffd8f7 ctrl: Introduce CTRL command subscriber.by-*.msisdn
This command provides getter and setter to set and retrieve the MSISDN
of a subscriber.

Related: SYS#5993
Change-Id: I5f2e807859f7e28e0984c8dc37edc69319fd8e10
2022-06-20 13:37:59 +02:00
Pau Espin d63ec88dba ctrl: Introduce cmd SET subscriber.create <imsi>
Create a new subscriber from CTRL, similar to VTY command
"imsi IDENT create".

On success SET_REPLY contains the ID of the newly created subscriber.

Related: SYS#5993
Change-Id: Id1b760cd07712245a0eeabaac7891bce93c1fe8e
2022-06-20 13:37:53 +02:00
Harald Welte e427bb299f update git URLs (git -> https; gitea)
Change-Id: Iaab27a8e258a29a0bb51ee8d9f5faeb2c025f139
2022-06-18 12:08:31 +02:00
Pau Espin d456fced21 Fix db_subscr_create() not returning -EEXIST expected by VTY subscriber create cmd
As a result, the -EEXIST code path printing a specific error for
inserting already existing subscribers was not being triggered.

Change-Id: Id24dc6e0ff5115c8c9025404dd7296250d2b03ee
2022-06-17 19:09:39 +02:00
Pau Espin c772e525ef tests/ctrl: Move ERROR test scenario to proper file
Change-Id: I26ba561c22c40877d99f2aed27be2df9faaa4bec
2022-06-17 17:07:56 +02:00
Pau Espin 83a41471da tests: Allow specyfing specific ctrl test to run
Similar to what's already available for vty tests.

Change-Id: I3b01edfb22197f4d46bd24e15bdcd37ea0382e4a
2022-06-17 17:03:25 +02:00
Pau Espin b4f25a0d1a ctrl: Mark function as static
Also move it more towards the end, where it is more expected as usually
done in ctrl/vty code.

Change-Id: Ieb956fb855752cfbe83d11aa0326685229a115e3
2022-06-17 15:56:27 +02:00
Vadim Yanitskiy b246580900 tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
When using 'check_PROGRAMS', autoconf/automake generates smarter
Makefiles, so that the test programs are not being compiled during
the normal 'make all', but only during 'make check'.

Change-Id: I70cf75b3cb6ae59c92248cc529546750fb0da07b
2022-04-14 02:22:14 +03:00
Vadim Yanitskiy 0c13953ed0 debian: add new 'osmo-mslookup-utils' package
Change-Id: I9dbe00187678a5032fb4ae32b496892fdc86ddb7
Related: OS#4706
2022-02-08 13:51:31 +06:00
Vadim Yanitskiy 77a1bf66e6 fixup: debian: remove unneeded dependency libdbd-sqlite3
Change-Id: I3ece7c32151f6f334d0595fdbf9099c930b22bb9
Fixes: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c
2022-02-05 22:52:22 +06:00
Oliver Smith 37a5b70195 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: I4b20c685b6370bf5dc472a42664e2665eb0d8f8c
2021-12-14 12:15:54 +01:00
Pau Espin 4d7cbfcc9a Bump version: 1.3.0.7-bfee → 1.4.0
Change-Id: I39bbc42009bf6291884f652618bfdf94b329a295
2021-11-16 14:56:41 +01:00