aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-04-02Split REJect cause by CN DOMAINrhizomatica/productionKeith Whyte5-20/+59
Allow using a distinct Reject Cause for CS and PS Domain. This breaks any existing config that defines custom reject-cause TODO: Add Alias or Hidden function or whatever to handle old config.
2023-11-23Add the VLR to the subscribers last-seen vty commandKeith2-4/+10
It's useful to see WHERE the subcriber was last seen in a distributed GSM configuration Change-Id: I658e42c965a95b23675d4333d262522206fd24c4
2023-11-23Add a time limit to show subscribers last-seenKeith1-1/+1
There was a comment in gerrit I7f0573381a6d0d13841ac6d42d50f0e8389decf4 mentioning concern that the show subscriber commands I added had no limits I see now my mistake. Change-Id: I170e1025d534881281379efee0f5f8f51b88fc06
2023-11-23Make local attach max age VTY configurableKeith3-1/+17
Change-Id: I14d1e6489001529ac2c96ddbf41605c33b05283b
2023-11-23VTY: Add proxy inspection and deleteKeith1-0/+99
Change-Id: I5d990b1c765e2bfb762012f0924e68c2856804bc
2023-11-22Implement subscriber-create-on-demand fallbackKeith6-3/+54
If the mslookup client gets no response with the configured timeout, then go ahead and create a local subscriber if subscriber-create-on-demand is so configured. Change-Id: I3755baa393f6cc6b766abf90ba0f3a062e4c0f5f
2023-11-22DGSM: Add ignore-created-on-demand optionKeith7-5/+83
When a subscriber is create(d)-on-demand (assuming configuration does not grant CS/PS access by default), then the following will be true: * The subscriber will never have connected, and therefore have no vlr_number entry. * The msisdn length will be the length configured in create-on-demand. * The subscriber will have no CS/PS access. Let's use these three conditions to 'detect' subscribers than have beeen created on demand, and ignore them in both the case of an incoming mslookup, and a local GSUP request. Change-Id: I40d40467316c360bcbd50d50cb2e52a38e718eac
2023-11-22mslookup: Add a flag to not stop on receive age: zeroKeith3-3/+19
This allows using the DGSM system to search for duplicate IMSI entries across all HLRs Change-Id: Ic69d6bc9834099ba3a7f3b6f8334b5eac90f2897
2023-11-22D-GSM: Add a query type for authorized imsi.Keith4-1/+10
Adds the possibility to use the DGSM/mDNS system to search all HLRs for only IMSIs that have either CS or PS service Change-Id: I54c469d34c3cd1bfd9a72a6c751ae183606d75ec
2023-11-22DGSM: add option to respond only for authorized IMSIsKeith7-4/+68
Adds a vty configuration option to the mslookup server which instructs the server to only reposnd to gsup.hlr queries for IMSIs that are both known AND have either Circuit Switched or Packet Switched access enabled. This helps in the case of so-called 'evil twin' IMSI entries, where, possibly due to subscriber-create-on-demand, as a result of a Location Update at a time when the home HLR was not reachable, the local hlr has an entry for an IMSI that in reality belongs to another HLR. NOTE: Network-wide concurrent use of subscriber-create-on-demand and the mslookup client is not currently possible, as the mslookup client has no fallback option to create-on-demand. A future commit, however will implement this fallback, thereby completing support for D-GSM with create-on-demand. Change-Id: I2643d6c93289ec0835fa1c00e275d627914775bc
2023-09-12Bump version: 1.6.0.20-37f0-dirty → 1.7.01.7.0Pau Espin Pedrol6-16/+49
Change-Id: I3f169ff8f9b10a4d4b5c50286951d326fa713245
2023-09-12Add support for multiple APN profiles for subscriber dataAlexander Couzens7-14/+311
Previously the HLR sent in the Insert Subscriber Data call only the wildcard APN as a single entry. This violates the spec because the first entry (with the lowest context_id) is always the default APN, but it is forbidden to have a wildcard APN as default apn. Introduce a default template/profile which can contain multiple APNs. This profile is always sent out to the SGSN/MME as part of Insert-Subscriber-Data. In the future a subscriber might have a profile template name written into the database which will resolve to a "pdp-profile premium" in the configuration. To be backward compatible, if the pdp-profile default section is missing, the HLR will send out only a wildcard APN. Config example: hlr ps pdp-profile default profile 1 apn internet profile 2 apn * Changes to the apn list will be only handed out to subscribers when the subscriber do a location update. Related: SYS#6391 Change-Id: I540132ee5dcfd09f4816e02e702927e1074ca50f
2023-08-29Add VTY support for TUAK algorithmHarald Welte3-9/+19
Change-Id: If2611658f7cb990b484d7429ab2f944f56fd2eb6 Depends: libosmocore.git Ib905b8d8bdf248e8299bf50666ee1bca8298433d
2023-08-29db: extend database schema to support 256bit K and/or OP[c] valuesHarald Welte7-31/+82
Other UMTS AKA algorithms than MILENAGE (notably TUAK) support K sizes of up to 256bit, or mandate a OP/OPc size of 256 bit. Let's extend our database schema to accommodate such larger sizes. Change-Id: Ibbde68484c904507a15c35cbfdf88cd47d0c7039
2023-07-21USSD: fix handling of ussd-DataCodingScheme != 0x0fVadim Yanitskiy1-2/+33
The usual Data Coding Scheme value in the mobile-originated USSD request (processUnstructuredSS-Request) is 0x0f, which means: 0000 .... = Coding Group: Coding Group 0 (Language using the GSM 7 bit default alphabet) .... 1111 = Language: unspecified However some modems are known to use a different default value, if not specified explicitly (AT+CUSD has optional DCS parameter): 0000 .... = Coding Group: Coding Group 0 (Language using the GSM 7 bit default alphabet) .... 0000 = Language: German (0) In function rx_proc_ss_req(), we should not be using req.ussd_text, because this field has been deprecated and may contain unexpected data. For example, in the abovementioned case it would contain the 7 bit encoded ussd-String 'aa510c061b01'O and osmo-hlr would indeed fail to find a matching route for a non-ASCII string. Instead of relaying on gsm0480_parse_facility_ie(), let's check the Data Coding Scheme value and decode the request string ourselves. Expect the Coding Group 0, but be more tolerant to the indicated language: print a warning and treat it as '1111'B (unspecified). Change-Id: Ib7bac660b1a7942adcfbe7b14f162c95061a25db Related: OS#6075
2023-07-05gsup_server: fix msgb memleak in osmo_gsup_server_read_cb()Vadim Yanitskiy1-4/+2
I noticed that inability to send IPA PONG in response to IPA PING from osmo-{msc,sgsn} results in an "IPA Multiplex" chunk being leaked. No matter what's returned from ipa_server_conn_ccm(), we need to free the msgb containing the incoming IPA message. Change-Id: I5c5acbffc2913f78db4894ae3633b5eca9c2e8d6
2023-07-05ussd: fix GSUP memleaks in rx_proc_ss_{req,error}()Vadim Yanitskiy1-1/+5
Also take a chance to use a more suitable error cause value. Change-Id: I22ba5ad470989b7e8ba8fe2be170eac4adcb48c5
2023-07-05lu_fsm: fix memleak in lu_fsm_wait_insert_data_result()Vadim Yanitskiy1-0/+1
Currently osmo-hlr leaks memory (msgb holding 1203 bytes of data and a struct osmo_gsup_req) on receipt of OSMO_GSUP_MSGT_INSERT_DATA_ERROR. Change-Id: I4c70a06169158c869360707a7a62436dbf13b9b3
2023-06-14src/db.c: Switch from "const char *statements" to "const char * const"Harald Welte2-8/+8
This is primarily to make the linter happy, which spews "static const char * array should probably be static const char * const" errors in gerrit when adding similar new code to this existing file. So let's first convert the old code and then add new code that makes the linter happy. I guess it does have a point, as both the individual string pointers as well as the array of the pointers are constant. Change-Id: I39e9fb6bd8052f4878cfc95061775bf940631ae5
2023-06-14Port to new libosmogsm 'struct osmo_sub_auth_data2'Harald Welte12-134/+168
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-03cosmetic: gen_ts_55_205_test_sets/main_template tabs istead of spacesHarald Welte1-2/+2
Let's consistently use our normal tab indent style Change-Id: I4172b59131ac4166174c1860fcb07b7bee3df728
2023-06-03cosmetic: gen_ts_55_205_test_sets/func_template.c: Use tab-indentHarald Welte1-27/+27
This templates is used for generating C code, so it should use our normal tab-based code indenting. Change-Id: I0be7eb2d7b551d7eaaee15994ef37262694819f6
2023-05-30Introduce support for XOR-2G algorithmHarald Welte13-36/+43
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-26systemd: depend on networking-online.targetOliver Smith1-0/+2
Related: SYS#6400 Change-Id: I29e547242b2ed1cfc4750c7d7e5f8636c2e8f3dc
2023-05-10hlr: use talloc for memory allocation in ↵Alexander Couzens4-28/+13
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-04-25debian: set compat level to 10Oliver Smith2-2/+2
Related: OS#5958 Change-Id: I5d26ab03aacf3b8ef8c1c4c669c12090fd0b7899
2023-03-14tests/*/Makefile.am: move -I to AM_CPPFLAGSVadim Yanitskiy4-4/+7
Change-Id: I654053e11b0cc824c198f68e4ff0a0fcb295efb0
2023-03-14tests/auc/Makefile.am: put object files to LDADDVadim Yanitskiy1-4/+4
Change-Id: Iaefcfe7a8904841a29094fe40eb5850912544b4c
2023-03-14mslookup: Call osmo_fd_unregister() before closing and changing bfd->fdPau Espin Pedrol1-2/+2
Change-Id: I26bba0dd092ad5fd6b4959b173fae93b542a93f1
2023-02-22tests/db/db_test.err: adjust to XOR-3G renameOliver Smith3-4/+4
Adjust the test to the related libosmocore change. Related: libosmocore I446e54d0ddf4a18c46ee022b1249af73552e3ce1 Change-Id: I68878d24340659f888e5e348b937161cffbd54e2
2023-02-20Run struct_endianness.pyOliver Smith1-1/+1
Ensure there is no diff to prepare to run this in CI. Related: OS#5884 Change-Id: I4294a18871214b70cef267fcaaaaada42cb61bf9
2023-02-07Bump version: 1.5.0.19-268a-dirty → 1.6.01.6.0Pau Espin Pedrol6-25/+64
Change-Id: Ide480a902bbfadefa396f3a0cb925f5dceab4f9c
2023-01-20Add vty `reject-cause` to set the reject causeAlexander Couzens7-6/+98
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-15fix memleak of proxy_subscr_listentryNeels Hofmeyr1-0/+1
Patch-by: whytek Related: OS#5854 Change-Id: Ic1ec4911fa5ae91cc75aa865c8201edd83af41ed
2022-12-27Vty: Fixup config shown/written from vtyKeith4-24/+29
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-23osmo_mdns_rfc_record/question_encode: remove ctxOliver Smith4-8/+8
Remove the ctx argument to both functions, as it's not used anymore. Related: OS#5821 Change-Id: I5e3dd18bf08f7aa42f49c262e13250778ea0c6a2
2022-12-23mslookup: use apn functions from libosmocoreOliver Smith4-339/+34
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-23osmo_mdns_rfc_record_decode: proper free on errOliver Smith1-1/+1
Free the whole talloc tree of ret if we can't allocate memory for ret->rdata. Related: OS#5821 Change-Id: Iefc89e3c75a4bf4ffee3871c7b551a2a608f7d5f
2022-12-23osmo_mdns_rfc_record_decode: check ret of tallocOliver Smith1-1/+5
Related: OS#5821 Change-Id: Icd0f54a8eb80ca50976f248e017f6e5c727385f3
2022-12-23osmo-hlr: Transition to use of 'telnet_init_default'arehbein1-2/+1
Related: OS#5809 Change-Id: I5cee719a9c4437712915f0f9760d606f6ec2dd43
2022-12-17ctrl: take both address and port from vty configMax3-7/+2
Change-Id: Iecae15333a4e77b38d9bce8c8e591af3d5fcf347
2022-11-03Add -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definitionHarald Welte1-0/+1
... if --enable-werror is used Change-Id: Id465254bf12eb84acb116c86711a5b52b4d3ad35
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte15-33/+33
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-09-24hlr_vty.c: fix typoMax1-1/+1
Change-Id: If79ebd9a8998e64be55e52af43e426f37e3972af
2022-09-18Debian: install osmo-hlr-dgsm.cfg as example configMax1-0/+1
Related: OS#4107 Change-Id: Ia64f14ada006acb31c5f725dfa0d52f482d3e8b4
2022-09-18systemd: enable basic hardeningMax1-0/+1
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-18Debian: reformat package descriptionMax1-2/+3
Shorten the lines of package description to comply with Debian Policy Manual section 3.4.1 Related: OS#4107 Change-Id: Id6bbfc0b013f0e8da80af76206d3ac7fd6b6b0d4
2022-09-18Debian: bump copyright year to match currentMax1-1/+1
Related: OS#4107 Change-Id: I581e62b5410a9dddc6b5fd974081d633cc20416d
2022-09-09Ignore .deb build byproductsMax1-0/+16
Change-Id: Id36f55cd55be25f764c2b9515eff84d106bab1dc
2022-08-29Set working directory in systemd service fileMax2-1/+2
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