Projects
osmocom:latest
osmo-hlr
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
osmo-hlr.spec
Changed
@@ -15,13 +15,13 @@ Name: osmo-hlr Requires: osmocom-latest -Version: 1.6.2 +Version: 1.7.0 Release: 0 Summary: Osmocom Home Location Register for GSUP protocol towards OsmoSGSN and OsmoCSCN License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Productivity/Telephony/Servers URL: https://osmocom.org/projects/osmo-hlr -Source: osmo-hlr_1.6.2.tar.xz +Source: osmo-hlr_1.7.0.tar.xz Source1: rpmlintrc BuildRequires: autoconf BuildRequires: automake @@ -31,11 +31,11 @@ %if 0%{?suse_version} BuildRequires: systemd-rpm-macros %endif -BuildRequires: pkgconfig(libosmoabis) >= 1.4.0 -BuildRequires: pkgconfig(libosmocore) >= 1.8.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.8.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.8.0 -BuildRequires: pkgconfig(libosmovty) >= 1.8.0 +BuildRequires: pkgconfig(libosmoabis) >= 1.5.0 +BuildRequires: pkgconfig(libosmocore) >= 1.9.0 +BuildRequires: pkgconfig(libosmoctrl) >= 1.9.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.9.0 +BuildRequires: pkgconfig(libosmovty) >= 1.9.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(talloc) >= 2.0.1 # only needed for populate_hlr_db.pl
View file
osmo-hlr_1.6.2.dsc -> osmo-hlr_1.7.0.dsc
Changed
@@ -2,13 +2,13 @@ Source: osmo-hlr Binary: osmo-hlr, osmo-hlr-dbg, libosmo-gsup-client0, libosmo-gsup-client-dev, libosmo-mslookup1, libosmo-mslookup-dev, osmo-mslookup-utils, osmo-hlr-doc Architecture: any all -Version: 1.6.2 +Version: 1.7.0 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hlr Standards-Version: 3.9.6 Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr -Build-Depends: debhelper (>= 9), pkg-config, dh-autoreconf, autotools-dev, python3-minimal, libosmocore-dev (>= 1.8.0), libosmo-abis-dev (>= 1.4.0), libosmo-netif-dev (>= 1.3.0), libsqlite3-dev, sqlite3, osmo-gsm-manuals-dev (>= 1.4.0) +Build-Depends: debhelper (>= 10), pkg-config, dh-autoreconf, autotools-dev, python3-minimal, libosmocore-dev (>= 1.9.0), libosmo-abis-dev (>= 1.5.0), libosmo-netif-dev (>= 1.4.0), libsqlite3-dev, sqlite3, osmo-gsm-manuals-dev (>= 1.5.0) Package-List: libosmo-gsup-client-dev deb net optional arch=any libosmo-gsup-client0 deb libs optional arch=any @@ -19,8 +19,8 @@ osmo-hlr-doc deb doc optional arch=all osmo-mslookup-utils deb utils optional arch=any Checksums-Sha1: - f394a3764a307eb706979418c47b4699be6b20e0 172304 osmo-hlr_1.6.2.tar.xz + 8731f52ebdda028b265bf25266a86159fa2efd4a 174520 osmo-hlr_1.7.0.tar.xz Checksums-Sha256: - e1adfa4721652c14c0bc513846ba820df4ba7d1039c42dbb47e1bb677179373a 172304 osmo-hlr_1.6.2.tar.xz + 9b7c7f920e4017f4af101dd78bcda5305e86b292e40b3f664da49c4a757fd892 174520 osmo-hlr_1.7.0.tar.xz Files: - 432dfab6d84ffd5c03cfa8c6a7ad3fbb 172304 osmo-hlr_1.6.2.tar.xz + cae8d41c0a36b375dc6eb4c52345df24 174520 osmo-hlr_1.7.0.tar.xz
View file
osmo-hlr_1.6.2.tar.xz/.tarball-version -> osmo-hlr_1.7.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.6.2 +1.7.0
View file
osmo-hlr_1.6.2.tar.xz/configure.ac -> osmo-hlr_1.7.0.tar.xz/configure.ac
Changed
@@ -41,11 +41,11 @@ PKG_CHECK_MODULES(TALLOC, talloc >= 2.0.1) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.8.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.8.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.8.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.8.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.4.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.5.0) PKG_CHECK_MODULES(SQLITE3, sqlite3)
View file
osmo-hlr_1.6.2.tar.xz/contrib/osmo-hlr.spec.in -> osmo-hlr_1.7.0.tar.xz/contrib/osmo-hlr.spec.in
Changed
@@ -30,11 +30,11 @@ %if 0%{?suse_version} BuildRequires: systemd-rpm-macros %endif -BuildRequires: pkgconfig(libosmoabis) >= 1.4.0 -BuildRequires: pkgconfig(libosmocore) >= 1.8.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.8.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.8.0 -BuildRequires: pkgconfig(libosmovty) >= 1.8.0 +BuildRequires: pkgconfig(libosmoabis) >= 1.5.0 +BuildRequires: pkgconfig(libosmocore) >= 1.9.0 +BuildRequires: pkgconfig(libosmoctrl) >= 1.9.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.9.0 +BuildRequires: pkgconfig(libosmovty) >= 1.9.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(talloc) >= 2.0.1 # only needed for populate_hlr_db.pl
View file
osmo-hlr_1.6.2.tar.xz/debian/changelog -> osmo-hlr_1.7.0.tar.xz/debian/changelog
Changed
@@ -1,15 +1,36 @@ -osmo-hlr (1.6.2) unstable; urgency=medium +osmo-hlr (1.7.0) unstable; urgency=medium + Oliver Smith + * Run struct_endianness.py + * tests/db/db_test.err: adjust to XOR-3G rename + * debian: set compat level to 10 * systemd: depend on networking-online.target - -- Oliver Smith <osmith@sysmocom.de> Fri, 26 May 2023 14:54:12 +0200 - -osmo-hlr (1.6.1) unstable; urgency=medium + Pau Espin Pedrol + * mslookup: Call osmo_fd_unregister() before closing and changing bfd->fd - * Run struct_endianness.py - * tests: adjust to XOR-3G rename in libosmocore + Vadim Yanitskiy + * tests/auc/Makefile.am: put object files to LDADD + * tests/*/Makefile.am: move -I to AM_CPPFLAGS + * lu_fsm: fix memleak in lu_fsm_wait_insert_data_result() + * ussd: fix GSUP memleaks in rx_proc_ss_{req,error}() + * gsup_server: fix msgb memleak in osmo_gsup_server_read_cb() + * USSD: fix handling of ussd-DataCodingScheme != 0x0f + + Alexander Couzens + * hlr: use talloc for memory allocation in osmo_gsup_create_insert_subscriber_data_msg + * Add support for multiple APN profiles for subscriber data + + Harald Welte + * Introduce support for XOR-2G algorithm + * cosmetic: gen_ts_55_205_test_sets/func_template.c: Use tab-indent + * cosmetic: gen_ts_55_205_test_sets/main_template tabs istead of spaces + * Port to new libosmogsm 'struct osmo_sub_auth_data2' + * src/db.c: Switch from "const char *statements" to "const char * const" + * db: extend database schema to support 256bit K and/or OPc values + * Add VTY support for TUAK algorithm - -- Oliver Smith <osmith@sysmocom.de> Thu, 23 Feb 2023 10:23:04 +0100 + -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 12 Sep 2023 14:41:33 +0200 osmo-hlr (1.6.0) unstable; urgency=medium
View file
osmo-hlr_1.6.2.tar.xz/debian/compat -> osmo-hlr_1.7.0.tar.xz/debian/compat
Changed
@@ -1 +1 @@ -9 +10
View file
osmo-hlr_1.6.2.tar.xz/debian/control -> osmo-hlr_1.7.0.tar.xz/debian/control
Changed
@@ -2,17 +2,17 @@ Section: net Priority: optional Maintainer: Osmocom team <openbsc@lists.osmocom.org> -Build-Depends: debhelper (>= 9), +Build-Depends: debhelper (>= 10), pkg-config, dh-autoreconf, autotools-dev, python3-minimal, - libosmocore-dev (>= 1.8.0), - libosmo-abis-dev (>= 1.4.0), - libosmo-netif-dev (>= 1.3.0), + libosmocore-dev (>= 1.9.0), + libosmo-abis-dev (>= 1.5.0), + libosmo-netif-dev (>= 1.4.0), libsqlite3-dev, sqlite3, - osmo-gsm-manuals-dev (>= 1.4.0) + osmo-gsm-manuals-dev (>= 1.5.0) Standards-Version: 3.9.6 Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr
View file
osmo-hlr_1.6.2.tar.xz/doc/examples/osmo-hlr.cfg -> osmo-hlr_1.7.0.tar.xz/doc/examples/osmo-hlr.cfg
Changed
@@ -24,3 +24,9 @@ bind ip 127.0.0.1 ussd route prefix *#100# internal own-msisdn ussd route prefix *#101# internal own-imsi + ps + pdp-profiles default + profile 1 + apn internet + profile 2 + apn *
View file
osmo-hlr_1.6.2.tar.xz/include/osmocom/hlr/auc.h -> osmo-hlr_1.7.0.tar.xz/include/osmocom/hlr/auc.h
Changed
@@ -3,6 +3,6 @@ #include <osmocom/crypt/auth.h> int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, - struct osmo_sub_auth_data *aud2g, - struct osmo_sub_auth_data *aud3g, + struct osmo_sub_auth_data2 *aud2g, + struct osmo_sub_auth_data2 *aud3g, const uint8_t *rand_auts, const uint8_t *auts);
View file
osmo-hlr_1.6.2.tar.xz/include/osmocom/hlr/db.h -> osmo-hlr_1.7.0.tar.xz/include/osmocom/hlr/db.h
Changed
@@ -70,8 +70,8 @@ /* obtain the authentication data for a given imsi */ int db_get_auth_data(struct db_context *dbc, const char *imsi, - struct osmo_sub_auth_data *aud2g, - struct osmo_sub_auth_data *aud3g, + struct osmo_sub_auth_data2 *aud2g, + struct osmo_sub_auth_data2 *aud3g, int64_t *subscr_id); int db_update_sqn(struct db_context *dbc, int64_t id, @@ -121,7 +121,7 @@ * See https://sqlite.org/lang_datefunc.html, function datetime(). */ #define DB_LAST_LU_SEEN_FMT "%Y-%m-%d %H:%M:%S" -/* Like struct osmo_sub_auth_data, but the keys are in hexdump representation. +/* Like struct osmo_sub_auth_data2, but the keys are in hexdump representation. * This is useful because SQLite requires them in hexdump format, and callers * like the VTY and CTRL interface also have them available as hexdump to begin * with. In the binary format, a VTY command would first need to hexparse,
View file
osmo-hlr_1.6.2.tar.xz/include/osmocom/hlr/gsup_server.h -> osmo-hlr_1.7.0.tar.xz/include/osmocom/hlr/gsup_server.h
Changed
@@ -69,8 +69,6 @@ int osmo_gsup_configure_wildcard_apn(struct osmo_gsup_message *gsup, uint8_t *apn_buf, size_t apn_buf_size); int osmo_gsup_create_insert_subscriber_data_msg(struct osmo_gsup_message *gsup, const char *imsi, const char *msisdn, - uint8_t *msisdn_enc, size_t msisdn_enc_size, - uint8_t *apn_buf, size_t apn_buf_size, - enum osmo_gsup_cn_domain cn_domain); + enum osmo_gsup_cn_domain cn_domain, void *talloc_ctx); int osmo_gsup_forward_to_local_peer(struct osmo_gsup_server *server, const struct osmo_cni_peer_id *to_peer, struct osmo_gsup_req *req, struct osmo_gsup_message *modified_gsup);
View file
osmo-hlr_1.6.2.tar.xz/include/osmocom/hlr/hlr.h -> osmo-hlr_1.7.0.tar.xz/include/osmocom/hlr/hlr.h
Changed
@@ -58,6 +58,14 @@ struct hlr_euse *euse_default; enum gsm48_gmm_cause reject_cause; enum gsm48_gmm_cause no_proxy_reject_cause; + /* PS: APN default configuration used by Subscription Data on ISR */ + struct { + struct { + bool enabled; + struct osmo_gsup_pdp_info pdp_infosOSMO_GSUP_MAX_NUM_PDP_INFO; + size_t num_pdp_infos; + } pdp_profile; + } ps; /* NCSS (call independent) session guard timeout value */ int ncss_guard_timeout;
View file
osmo-hlr_1.6.2.tar.xz/include/osmocom/hlr/hlr_vty.h -> osmo-hlr_1.7.0.tar.xz/include/osmocom/hlr/hlr_vty.h
Changed
@@ -35,11 +35,15 @@ MSLOOKUP_SERVER_NODE, MSLOOKUP_SERVER_MSC_NODE, MSLOOKUP_CLIENT_NODE, + PS_NODE, + PS_PDP_PROFILES_NODE, + PS_PDP_PROFILES_PROFILE_NODE, }; #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 +#define A38_XOR2G_KEY_LEN 16 #define A38_COMP128_KEY_LEN 16 #define MILENAGE_KEY_LEN 16
View file
osmo-hlr_1.6.2.tar.xz/sql/hlr.sql -> osmo-hlr_1.7.0.tar.xz/sql/hlr.sql
Changed
@@ -71,9 +71,9 @@ CREATE TABLE auc_3g ( subscriber_id INTEGER PRIMARY KEY, -- subscriber.id algo_id_3g INTEGER NOT NULL, -- enum osmo_auth_algo value - k VARCHAR(32) NOT NULL, -- hex string: subscriber's secret key (128bit) - op VARCHAR(32), -- hex string: operator's secret key (128bit) - opc VARCHAR(32), -- hex string: derived from OP and K (128bit) + k VARCHAR(64) NOT NULL, -- hex string: subscriber's secret key (128/256bit) + op VARCHAR(64), -- hex string: operator's secret key (128/256bit) + opc VARCHAR(64), -- hex string: derived from OP and K (128/256bit) sqn INTEGER NOT NULL DEFAULT 0, -- sequence number of key usage -- nr of index bits at lower SQN end ind_bitlen INTEGER NOT NULL DEFAULT 5 @@ -91,4 +91,4 @@ -- Set HLR database schema version number -- Note: This constant is currently duplicated in src/db.c and must be kept in sync! -PRAGMA user_version = 6; +PRAGMA user_version = 7;
View file
osmo-hlr_1.6.2.tar.xz/src/Makefile.am -> osmo-hlr_1.7.0.tar.xz/src/Makefile.am
Changed
@@ -111,7 +111,7 @@ db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_sql2c.sed echo "/* DO NOT EDIT THIS FILE. It is generated from files in osmo-hlr.git/sql/ */" > "$@" echo "#pragma once" >> "$@" - echo "static const char *stmt_bootstrap_sql = {" >> "$@" + echo "static const char * const stmt_bootstrap_sql = {" >> "$@" cat "$(BOOTSTRAP_SQL)" \ | sed -f "$(srcdir)/db_sql2c.sed" \ >> "$@"
View file
osmo-hlr_1.6.2.tar.xz/src/auc.c -> osmo-hlr_1.7.0.tar.xz/src/auc.c
Changed
@@ -1,4 +1,4 @@ -/* (C) 2015 by Harald Welte <laforge@gnumonks.org> +/* (C) 2015-2023 by Harald Welte <laforge@gnumonks.org> * * All Rights Reserved * @@ -32,8 +32,8 @@ /* compute given number of vectors using either aud2g or aud2g or a combination * of both. Handles re-synchronization if rand_auts and auts are set */ int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, - struct osmo_sub_auth_data *aud2g, - struct osmo_sub_auth_data *aud3g, + struct osmo_sub_auth_data2 *aud2g, + struct osmo_sub_auth_data2 *aud3g, const uint8_t *rand_auts, const uint8_t *auts) { unsigned int i; @@ -93,10 +93,10 @@ : "2G only", auts? ", with AUTS resync" : ""); if (aud3g) { - DBGP("3G: k = %s\n", hexb(aud3g->u.umts.k)); + DBGP("3G: k = %s\n", hex(aud3g->u.umts.k, aud3g->u.umts.k_len)); DBGP("3G: %s = %s\n", aud3g->u.umts.opc_is_op? "OP" : "opc", - hexb(aud3g->u.umts.opc)); + hex(aud3g->u.umts.opc, aud3g->u.umts.opc_len)); DBGP("3G: for sqn ind %u, previous sqn was %" PRIu64 "\n", aud3g->u.umts.ind, aud3g->u.umts.sqn); } @@ -115,6 +115,9 @@ if (aud3g) { /* 3G or 3G + 2G case */ + /* backwards-compatibiliy: We assume all RES are 8 bytes long */ + veci.res_len = 8; + /* Do AUTS only for the first vector or we would use * the same SQN for each following key. */ if ((i == 0) && auts) { @@ -123,10 +126,10 @@ DBGP("vector %u: resync: rand_auts = %s\n", i, hex(rand_auts, 16)); - rc = osmo_auth_gen_vec_auts(vec+i, aud3g, auts, + rc = osmo_auth_gen_vec_auts2(vec+i, aud3g, auts, rand_auts, rand); } else { - rc = osmo_auth_gen_vec(vec+i, aud3g, rand); + rc = osmo_auth_gen_vec2(vec+i, aud3g, rand); } if (rc < 0) { LOGP(DAUC, LOGL_ERROR, "Error in 3G vector " @@ -154,7 +157,7 @@ DBGP("vector %u: calculating 2G separately\n", i); - rc = osmo_auth_gen_vec(&vtmp, aud2g, rand); + rc = osmo_auth_gen_vec2(&vtmp, aud2g, rand); if (rc < 0) { LOGP(DAUC, LOGL_ERROR, "Error in 2G vector" "generation: %u: rc = %d\n", i, rc); @@ -165,7 +168,7 @@ veci.auth_types |= OSMO_AUTH_TYPE_GSM; } else { /* 2G only case */ - rc = osmo_auth_gen_vec(vec+i, aud2g, rand); + rc = osmo_auth_gen_vec2(vec+i, aud2g, rand); if (rc < 0) { LOGP(DAUC, LOGL_ERROR, "Error in 2G vector " "generation: %u: rc = %d\n", i, rc);
View file
osmo-hlr_1.6.2.tar.xz/src/ctrl.c -> osmo-hlr_1.7.0.tar.xz/src/ctrl.c
Changed
@@ -1,6 +1,6 @@ /* OsmoHLR Control Interface implementation */ -/* (C) 2017 sysmocom s.f.m.c. GmbH <info@sysmocom.de> +/* (C) 2017-2023 sysmocom s.f.m.c. GmbH <info@sysmocom.de> * All Rights Reserved * * Author: Max Suraev <msuraev@sysmocom.de> @@ -39,7 +39,7 @@ #define SEL_BY_ID SEL_BY "id-" extern bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo, - int *minlen, int *maxlen); + int *minlen, int *maxlen, int *minlen_opc, int *maxlen_opc); #define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) @@ -166,7 +166,7 @@ ); } -static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data2 *aud) { if (aud->algo == OSMO_AUTH_ALG_NONE) return; @@ -178,7 +178,7 @@ hexdump_buf(aud->u.gsm.ki)); } -static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data2 *aud) { if (aud->algo == OSMO_AUTH_ALG_NONE) return; @@ -187,7 +187,7 @@ "\naud3g.k\t%s" , osmo_auth_alg_name(aud->algo), - hexdump_buf(aud->u.umts.k)); + osmo_hexdump_nospc(aud->u.umts.k, aud->u.umts.k_len)); /* hexdump uses a static string buffer, hence only one hexdump per * printf(). */ ctrl_cmd_reply_printf(cmd, @@ -196,7 +196,7 @@ "\naud3g.sqn\t%" PRIu64 , aud->u.umts.opc_is_op? "op" : "opc", - hexdump_buf(aud->u.umts.opc), + osmo_hexdump_nospc(aud->u.umts.opc, aud->u.umts.opc_len), aud->u.umts.ind_bitlen, aud->u.umts.sqn); } @@ -291,8 +291,8 @@ static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) { const char *imsi; - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; struct hlr *hlr = data; const char *by_selector = cmd->node; int rc; @@ -327,8 +327,8 @@ static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; struct hlr *hlr = data; const char *by_selector = cmd->node; int rc; @@ -492,8 +492,8 @@ struct hlr_subscriber subscr; struct hlr *hlr = data; const char *by_selector = cmd->node; - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g_unused; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g_unused; int rc; if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) @@ -550,7 +550,7 @@ } if (strcmp(tok, "none") == 0) { aud2g.algo = OSMO_AUTH_ALG_NONE; - } else if (!auth_algo_parse(tok, &aud2g.algo, &minlen, &maxlen)) { + } else if (!auth_algo_parse(tok, &aud2g.algo, &minlen, &maxlen, NULL, NULL)) { cmd->reply = "Unknown auth algorithm."; return CTRL_CMD_ERROR; } @@ -592,8 +592,8 @@ struct hlr_subscriber subscr; struct hlr *hlr = data; const char *by_selector = cmd->node; - struct osmo_sub_auth_data aud2g_unused; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g_unused; + struct osmo_sub_auth_data2 aud3g; int rc; if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) @@ -618,9 +618,9 @@ } cmd->reply = talloc_asprintf(cmd, "%s,%s,%s,%s,%u", osmo_auth_alg_name(aud3g.algo), - osmo_hexdump_nospc_c(cmd, aud3g.u.umts.k, sizeof(aud3g.u.umts.k)), + osmo_hexdump_nospc_c(cmd, aud3g.u.umts.k, aud3g.u.umts.k_len), aud3g.u.umts.opc_is_op ? "OP" : "OPC", - osmo_hexdump_nospc_c(cmd, aud3g.u.umts.opc, sizeof(aud3g.u.umts.opc)), + osmo_hexdump_nospc_c(cmd, aud3g.u.umts.opc, aud3g.u.umts.opc_len), aud3g.u.umts.ind_bitlen); return CTRL_CMD_REPLY; } @@ -630,8 +630,8 @@ struct hlr *hlr = data; const char *by_selector = cmd->node; char *tmp = NULL, *tok, *saveptr; - int minlen = 0; - int maxlen = 0; + int minlen = 0, minlen_opc = 0; + int maxlen = 0, maxlen_opc = 0; struct sub_auth_data_str aud3g = { .type = OSMO_AUTH_TYPE_UMTS, .u.umts = { @@ -657,7 +657,7 @@ } if (strcmp(tok, "none") == 0) { aud3g.algo = OSMO_AUTH_ALG_NONE; - } else if (!auth_algo_parse(tok, &aud3g.algo, &minlen, &maxlen)) { + } else if (!auth_algo_parse(tok, &aud3g.algo, &minlen, &maxlen, &minlen_opc, &maxlen_opc)) { cmd->reply = "Unknown auth algorithm."; return CTRL_CMD_ERROR; } @@ -699,7 +699,7 @@ } aud3g.u.umts.opc = tok; - if (!osmo_is_hexstr(aud3g.u.umts.opc, MILENAGE_KEY_LEN * 2, MILENAGE_KEY_LEN * 2, true)) { + if (!osmo_is_hexstr(aud3g.u.umts.opc, minlen_opc * 2, maxlen_opc * 2, true)) { cmd->reply = talloc_asprintf(cmd, "Invalid OP/OPC."); return CTRL_CMD_ERROR; }
View file
osmo-hlr_1.6.2.tar.xz/src/db.c -> osmo-hlr_1.7.0.tar.xz/src/db.c
Changed
@@ -1,4 +1,4 @@ -/* (C) 2015 by Harald Welte <laforge@gnumonks.org> +/* (C) 2015-2023 by Harald Welte <laforge@gnumonks.org> * * All Rights Reserved * @@ -28,7 +28,7 @@ #include "db_bootstrap.h" /* This constant is currently duplicated in sql/hlr.sql and must be kept in sync! */ -#define CURRENT_SCHEMA_VERSION 6 +#define CURRENT_SCHEMA_VERSION 7 #define SEL_COLUMNS \ "id," \ @@ -235,7 +235,7 @@ talloc_free(dbc); } -static int db_run_statements(struct db_context *dbc, const char **statements, size_t statements_count) +static int db_run_statements(struct db_context *dbc, const char * const *statements, size_t statements_count) { int rc = 0; int i; @@ -308,7 +308,7 @@ db_upgrade_v1(struct db_context *dbc) { int rc; - const char *statements = { + const char * const statements = { "ALTER TABLE subscriber ADD COLUMN last_lu_seen TIMESTAMP default NULL", "PRAGMA user_version = 1", }; @@ -324,7 +324,7 @@ static int db_upgrade_v2(struct db_context *dbc) { int rc; - const char *statements = { + const char * const statements = { "ALTER TABLE subscriber ADD COLUMN imei VARCHAR(14)", "PRAGMA user_version = 2", }; @@ -437,7 +437,7 @@ "ms_purged_ps," \ "last_lu_seen" - const char *statements = { + const char * const statements = { "BEGIN TRANSACTION", "CREATE TEMPORARY TABLE subscriber_backup" SUBSCR_V3_CREATE, "INSERT INTO subscriber_backup SELECT " SUBSCR_V2_COLUMN_NAMES " FROM subscriber", @@ -460,7 +460,7 @@ static int db_upgrade_v4(struct db_context *dbc) { int rc; - const char *statements = { + const char * const statements = { "ALTER TABLE subscriber ADD COLUMN last_lu_seen_ps TIMESTAMP default NULL", "PRAGMA user_version = 4", }; @@ -476,7 +476,7 @@ static int db_upgrade_v5(struct db_context *dbc) { int rc; - const char *statements = { + const char * const statements = { "ALTER TABLE subscriber ADD COLUMN vlr_via_proxy VARCHAR", "ALTER TABLE subscriber ADD COLUMN sgsn_via_proxy VARCHAR", "PRAGMA user_version = 5", @@ -493,7 +493,7 @@ static int db_upgrade_v6(struct db_context *dbc) { int rc; - const char *statements = { + const char * const statements = { "CREATE TABLE ind (\n" " -- 3G auth IND pool to be used for this VLR\n" " ind INTEGER PRIMARY KEY,\n" @@ -513,6 +513,46 @@ return rc; } +static int db_upgrade_v7(struct db_context *dbc) +{ + int rc; + /* SQLite doesn't allow us to change the column type in-place, so we + * first rename the old table, create a new table and then copy + * the data over before deleting the old table */ +#define CREATE_AUC_3G_V7 \ +"CREATE TABLE auc_3g (\n" \ +" subscriber_id INTEGER PRIMARY KEY, -- subscriber.id\n" \ +" algo_id_3g INTEGER NOT NULL, -- enum osmo_auth_algo value\n" \ +" k VARCHAR(64) NOT NULL, -- hex string: subscriber's secret key (128/256bit)\n" \ +" op VARCHAR(64), -- hex string: operator's secret key (128/256bit)\n" \ +" opc VARCHAR(64), -- hex string: derived from OP and K (128/256bit)\n" \ +" sqn INTEGER NOT NULL DEFAULT 0, -- sequence number of key usage\n" \ +" -- nr of index bits at lower SQN end\n" \ +" ind_bitlen INTEGER NOT NULL DEFAULT 5\n" \ +");" + const char * const statements = { + "BEGIN TRANSACTION", + /* rename old table */ + "ALTER TABLE auc_3g RENAME TO old_auc_3g", + /* create new table */ + CREATE_AUC_3G_V7, + /* copy over old data */ + "INSERT INTO auc_3g SELECT subscriber_id, algo_id_3g, k, op, opc,sqn, ind_bitlen FROM old_auc_3g", + /* delete old table */ + "DROP TABLE old_auc_3g", + /* update user_version */ + "PRAGMA user_version = 7", + "COMMIT", + }; + + rc = db_run_statements(dbc, statements, ARRAY_SIZE(statements)); + if (rc != SQLITE_DONE) { + LOGP(DDB, LOGL_ERROR, "Unable to update HLR database schema to version 7\n"); + return rc; + } + return rc; +} + typedef int (*db_upgrade_func_t)(struct db_context *dbc); static db_upgrade_func_t db_upgrade_path = { db_upgrade_v1, @@ -521,6 +561,7 @@ db_upgrade_v4, db_upgrade_v5, db_upgrade_v6, + db_upgrade_v7, }; static int db_get_user_version(struct db_context *dbc)
View file
osmo-hlr_1.6.2.tar.xz/src/db_auc.c -> osmo-hlr_1.7.0.tar.xz/src/db_auc.c
Changed
@@ -1,4 +1,4 @@ -/* (C) 2015 by Harald Welte <laforge@gnumonks.org> +/* (C) 2015-2023 by Harald Welte <laforge@gnumonks.org> * * All Rights Reserved * @@ -74,9 +74,9 @@ } /* hexparse a specific column of a sqlite prepared statement into dst (with length check) - * returns 0 for success, -EIO on error */ -static int hexparse_stmt(uint8_t *dst, size_t dst_len, sqlite3_stmt *stmt, int col, const char *col_name, - const char *imsi) + * returns byte length in case of success, -EIO on error */ +static int hexparse_stmt(uint8_t *dst, size_t dst_len_min, size_t dst_len_max, sqlite3_stmt *stmt, + int col, const char *col_name, const char *imsi) { const uint8_t *text; size_t col_len; @@ -84,9 +84,15 @@ /* Bytes are stored as hex strings in database, hence divide length by two */ col_len = sqlite3_column_bytes(stmt, col) / 2; - if (col_len != dst_len) { - LOGAUC(imsi, LOGL_ERROR, "Error reading %s, expected length %lu but has length %lu\n", col_name, - dst_len, col_len); + if (col_len < dst_len_min) { + LOGAUC(imsi, LOGL_ERROR, "Error reading %s, expected min length %lu but has length %lu\n", col_name, + dst_len_min, col_len); + return -EIO; + } + + if (col_len > dst_len_max) { + LOGAUC(imsi, LOGL_ERROR, "Error reading %s, expected max length %lu but has length %lu\n", col_name, + dst_len_max, col_len); return -EIO; } @@ -96,10 +102,10 @@ return -EIO; } - if (osmo_hexparse((void *)text, dst, dst_len) != col_len) + if (osmo_hexparse((void *)text, dst, dst_len_max) != col_len) return -EINVAL; - return 0; + return col_len; } /* obtain the authentication data for a given imsi @@ -107,8 +113,8 @@ * -ENOENT if the IMSI is not known, -ENOKEY if the IMSI is known but has no auth data, * -EIO on db failure */ int db_get_auth_data(struct db_context *dbc, const char *imsi, - struct osmo_sub_auth_data *aud2g, - struct osmo_sub_auth_data *aud3g, + struct osmo_sub_auth_data2 *aud2g, + struct osmo_sub_auth_data2 *aud3g, int64_t *subscr_id) { sqlite3_stmt *stmt = dbc->stmtDB_STMT_AUC_BY_IMSI; @@ -142,7 +148,8 @@ /* obtain result values using sqlite3_column_*() */ if (sqlite3_column_type(stmt, 1) == SQLITE_INTEGER) { /* we do have some 2G authentication data */ - if (hexparse_stmt(aud2g->u.gsm.ki, sizeof(aud2g->u.gsm.ki), stmt, 2, "Ki", imsi)) + if (hexparse_stmt(aud2g->u.gsm.ki, sizeof(aud2g->u.gsm.ki), sizeof(aud2g->u.gsm.ki), + stmt, 2, "Ki", imsi) < 0) goto end_2g; aud2g->algo = sqlite3_column_int(stmt, 1); aud2g->type = OSMO_AUTH_TYPE_GSM; @@ -151,24 +158,30 @@ end_2g: if (sqlite3_column_type(stmt, 3) == SQLITE_INTEGER) { /* we do have some 3G authentication data */ - if (hexparse_stmt(aud3g->u.umts.k, sizeof(aud3g->u.umts.k), stmt, 4, "K", imsi)) { + rc = hexparse_stmt(aud3g->u.umts.k, 16, sizeof(aud3g->u.umts.k), stmt, 4, "K", imsi); + if (rc < 0) { ret = -EIO; goto out; } + aud3g->u.umts.k_len = rc; aud3g->algo = sqlite3_column_int(stmt, 3); /* UMTS Subscribers can have either OP or OPC */ if (sqlite3_column_text(stmt, 5)) { - if (hexparse_stmt(aud3g->u.umts.opc, sizeof(aud3g->u.umts.opc), stmt, 5, "OP", imsi)) { + rc = hexparse_stmt(aud3g->u.umts.opc, 16, sizeof(aud3g->u.umts.opc), stmt, 5, "OP", imsi); + if (rc < 0) { ret = -EIO; goto out; } + aud3g->u.umts.opc_len = rc; aud3g->u.umts.opc_is_op = 1; } else { - if (hexparse_stmt(aud3g->u.umts.opc, sizeof(aud3g->u.umts.opc), stmt, 6, "OPC", imsi)) { + rc = hexparse_stmt(aud3g->u.umts.opc, 16, sizeof(aud3g->u.umts.opc), stmt, 6, "OPC", imsi); + if (rc < 0) { ret = -EIO; goto out; } + aud3g->u.umts.opc_len = rc; aud3g->u.umts.opc_is_op = 0; } aud3g->u.umts.sqn = sqlite3_column_int64(stmt, 7); @@ -194,7 +207,7 @@ unsigned int num_vec, const uint8_t *rand_auts, const uint8_t *auts, bool separation_bit) { - struct osmo_sub_auth_data aud2g, aud3g; + struct osmo_sub_auth_data2 aud2g, aud3g; int64_t subscr_id; int ret = 0; int rc;
View file
osmo-hlr_1.6.2.tar.xz/src/db_hlr.c -> osmo-hlr_1.7.0.tar.xz/src/db_hlr.c
Changed
@@ -1,4 +1,4 @@ -/* (C) 2015 by Harald Welte <laforge@gnumonks.org> +/* (C) 2015-2023 by Harald Welte <laforge@gnumonks.org> * * All Rights Reserved * @@ -238,8 +238,9 @@ case OSMO_AUTH_ALG_COMP128v1: case OSMO_AUTH_ALG_COMP128v2: case OSMO_AUTH_ALG_COMP128v3: - case OSMO_AUTH_ALG_XOR: + case OSMO_AUTH_ALG_XOR_2G: break; + case OSMO_AUTH_ALG_XOR_3G: case OSMO_AUTH_ALG_MILENAGE: LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" " auth algo not suited for 2G: %s\n", @@ -267,11 +268,12 @@ switch (aud->algo) { case OSMO_AUTH_ALG_NONE: case OSMO_AUTH_ALG_MILENAGE: - case OSMO_AUTH_ALG_XOR: + case OSMO_AUTH_ALG_XOR_3G: break; case OSMO_AUTH_ALG_COMP128v1: case OSMO_AUTH_ALG_COMP128v2: case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR_2G: LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" " auth algo not suited for 3G: %s\n", osmo_auth_alg_name(aud->algo)); @@ -284,12 +286,12 @@ if (aud->algo == OSMO_AUTH_ALG_NONE) break; - if (!osmo_is_hexstr(aud->u.umts.k, 32, 32, true)) { + if (!osmo_is_hexstr(aud->u.umts.k, 32, 64, true)) { LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" " Invalid K: '%s'\n", aud->u.umts.k); return -EINVAL; } - if (!osmo_is_hexstr(aud->u.umts.opc, 32, 32, true)) { + if (!osmo_is_hexstr(aud->u.umts.opc, 32, 64, true)) { LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" " Invalid OP/OPC: '%s'\n", aud->u.umts.opc); return -EINVAL;
View file
osmo-hlr_1.6.2.tar.xz/src/gsup_server.c -> osmo-hlr_1.7.0.tar.xz/src/gsup_server.c
Changed
@@ -32,6 +32,7 @@ #include <osmocom/hlr/gsup_server.h> #include <osmocom/hlr/gsup_router.h> +#include <osmocom/hlr/hlr.h> #define LOG_GSUP_CONN(conn, level, fmt, args...) \ LOGP(DLGSUP, level, "GSUP peer %s: " fmt, \ @@ -179,11 +180,9 @@ if (hh->proto == IPAC_PROTO_IPACCESS) { rc = ipa_server_conn_ccm(conn, msg); - if (rc < 0) { - /* conn is already invalid here! */ - return -1; - } msgb_free(msg); + if (rc < 0) /* conn is already invalid here! */ + return -1; return 0; } @@ -446,19 +445,16 @@ * \paramout gsup The gsup message to populate. * \paramin imsi The subscriber's IMSI. * \paramin msisdn The subscriber's MSISDN. - * \paramout msisdn_enc A buffer large enough to store the MSISDN in encoded form. - * \paramin msisdn_enc_size Size of the buffer (must be >= OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN). - * \paramout apn_buf A buffer large enough to store an APN (required if cn_domain is OSMO_GSUP_CN_DOMAIN_PS). - * \paramin apn_buf_size Size of APN buffer (must be >= APN_MAXLEN). * \paramin cn_domain The CN Domain of the subscriber connection. + * \paramin talloc_ctx To allocation memory for dynamic fields (msisdn, apn) in the gsup field * \returns 0 on success, and negative on error. */ int osmo_gsup_create_insert_subscriber_data_msg(struct osmo_gsup_message *gsup, const char *imsi, const char *msisdn, - uint8_t *msisdn_enc, size_t msisdn_enc_size, - uint8_t *apn_buf, size_t apn_buf_size, - enum osmo_gsup_cn_domain cn_domain) + enum osmo_gsup_cn_domain cn_domain, + void *talloc_ctx) { int len; + uint8_t *msisdn_buf = talloc_size(talloc_ctx, OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN); OSMO_ASSERT(gsup); *gsup = (struct osmo_gsup_message){ @@ -467,27 +463,29 @@ osmo_strlcpy(gsup->imsi, imsi, sizeof(gsup->imsi)); - if (msisdn_enc_size < OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN) - return -ENOSPC; - - OSMO_ASSERT(msisdn_enc); - len = gsm48_encode_bcd_number(msisdn_enc, msisdn_enc_size, 0, msisdn); + len = gsm48_encode_bcd_number(msisdn_buf, OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN, 0, msisdn); if (len < 1) { LOGP(DLGSUP, LOGL_ERROR, "%s: Error: cannot encode MSISDN '%s'\n", imsi, msisdn); return -ENOSPC; } - gsup->msisdn_enc = msisdn_enc; + gsup->msisdn_enc = msisdn_buf; gsup->msisdn_enc_len = len; #pragma message "FIXME: deal with encoding the following data: gsup.hlr_enc" gsup->cn_domain = cn_domain; if (gsup->cn_domain == OSMO_GSUP_CN_DOMAIN_PS) { - OSMO_ASSERT(apn_buf_size >= APN_MAXLEN); - OSMO_ASSERT(apn_buf); - /* FIXME: PDP infos - use more fine-grained access control - instead of wildcard APN */ - osmo_gsup_configure_wildcard_apn(gsup, apn_buf, apn_buf_size); + if (g_hlr->ps.pdp_profile.enabled) { + OSMO_ASSERT(g_hlr->ps.pdp_profile.num_pdp_infos <= ARRAY_SIZE(g_hlr->ps.pdp_profile.pdp_infos)); + OSMO_ASSERT(g_hlr->ps.pdp_profile.num_pdp_infos <= ARRAY_SIZE(gsup->pdp_infos)); + memcpy(gsup->pdp_infos, + g_hlr->ps.pdp_profile.pdp_infos, + sizeof(struct osmo_gsup_pdp_info) * g_hlr->ps.pdp_profile.num_pdp_infos); + gsup->num_pdp_infos = g_hlr->ps.pdp_profile.num_pdp_infos; + } else { + uint8_t *apn_buf = talloc_size(talloc_ctx, APN_MAXLEN); + osmo_gsup_configure_wildcard_apn(gsup, apn_buf, APN_MAXLEN); + } } return 0;
View file
osmo-hlr_1.6.2.tar.xz/src/hlr.c -> osmo-hlr_1.7.0.tar.xz/src/hlr.c
Changed
@@ -85,8 +85,6 @@ llist_for_each_entry(co, &g_hlr->gs->clients, list) { struct osmo_gsup_message gsup = { }; - uint8_t msisdn_encOSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN; - uint8_t apnAPN_MAXLEN; struct msgb *msg_out; uint8_t *peer; int peer_len; @@ -131,8 +129,7 @@ subscr->imsi, cn_domain == OSMO_GSUP_CN_DOMAIN_PS ? "PS" : "CS", osmo_quote_str(peer_compare, -1)); - if (osmo_gsup_create_insert_subscriber_data_msg(&gsup, subscr->imsi, subscr->msisdn, msisdn_enc, - sizeof(msisdn_enc), apn, sizeof(apn), cn_domain) != 0) { + if (osmo_gsup_create_insert_subscriber_data_msg(&gsup, subscr->imsi, subscr->msisdn, cn_domain, OTC_SELECT) != 0) { LOGP(DLGSUP, LOGL_ERROR, "IMSI='%s': Cannot notify GSUP client; could not create gsup message " "for %s:%u\n", subscr->imsi, @@ -727,7 +724,7 @@ } static const char vlr_copyright = - "Copyright (C) 2016, 2017 by Harald Welte, sysmocom s.f.m.c. GmbH\r\n" + "Copyright (C) 2016-2023 by Harald Welte, sysmocom s.f.m.c. GmbH\r\n" "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n" "This is free software: you are free to change and redistribute it.\r\n" "There is NO WARRANTY, to the extent permitted by law.\r\n";
View file
osmo-hlr_1.6.2.tar.xz/src/hlr_ussd.c -> osmo-hlr_1.7.0.tar.xz/src/hlr_ussd.c
Changed
@@ -122,9 +122,40 @@ talloc_free(rt); } -static struct hlr_ussd_route *ussd_route_lookup_7bit(struct hlr *hlr, const char *ussd_code) +static struct hlr_ussd_route *ussd_route_lookup_for_req(struct hlr *hlr, const struct ss_request *req) { + const uint8_t cgroup = req->ussd_data_dcs >> 4; + const uint8_t lang = req->ussd_data_dcs & 0x0f; + char ussd_codeGSM0480_USSD_7BIT_STRING_LEN; struct hlr_ussd_route *rt; + + ussd_code0 = '\0'; + + /* We support only the Coding Group 0 (GSM 7-bit default alphabeet). In fact, + * the USSD request is usually limited to *#0-9, so we don't really need to + * support other coding groups and languages. */ + switch (cgroup) { + case 0: + /* The Language is usually set to '1111'B (unspecified), but some UEs + * are known to indicate '0000'B (German). */ + if (lang != 0x0f) { + LOGP(DSS, LOGL_NOTICE, "USSD DataCodingScheme (0x%02x): " + "the Language is usually set to 15 (unspecified), " + "but the request indicates %u - ignoring this\n", + req->ussd_data_dcs, lang); + /* do not abort, attempt to decode as if it was '1111'B */ + } + + gsm_7bit_decode_n_ussd(&ussd_code0, sizeof(ussd_code), + req->ussd_data, (req->ussd_data_len * 8) / 7); + break; + default: + LOGP(DSS, LOGL_ERROR, "USSD DataCodingScheme (0x%02x): " + "Coding Group %u is not supported, expecting Coding Group 0\n", + req->ussd_data_dcs, cgroup); + return NULL; + } + llist_for_each_entry(rt, &hlr->ussd_routes, list) { if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { LOGP(DSS, LOGL_DEBUG, "Found %s '%s' (prefix '%s') for USSD " @@ -603,7 +634,7 @@ } else { /* VLR->EUSE: MO USSD. VLR is known ('conn'), EUSE is to be resolved */ struct hlr_ussd_route *rt; - rt = ussd_route_lookup_7bit(hlr, (const char *) req.ussd_text); + rt = ussd_route_lookup_for_req(hlr, &req); if (rt) { if (rt->is_external) { ss->is_external = true; @@ -631,7 +662,8 @@ if (!ss) { LOGP(DSS, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", gsup->imsi, gsup->session_id); - osmo_gsup_req_respond_err(gsup_req, GMM_CAUSE_INV_MAND_INFO, "CONTINUE for unknown SS session"); + osmo_gsup_req_respond_err(gsup_req, GMM_CAUSE_MSGT_INCOMP_P_STATE, + "CONTINUE for unknown SS session"); return; } @@ -652,6 +684,8 @@ if (!ss) { LOGP(DSS, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", gsup->imsi, gsup->session_id); + osmo_gsup_req_respond_err(gsup_req, GMM_CAUSE_MSGT_INCOMP_P_STATE, + "END for unknown SS session"); return; } @@ -682,4 +716,5 @@ { LOGP(DSS, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", req->gsup.imsi, req->gsup.session_id, osmo_gsup_session_state_name(req->gsup.session_state)); + osmo_gsup_req_free(req); }
View file
osmo-hlr_1.6.2.tar.xz/src/hlr_vty.c -> osmo-hlr_1.7.0.tar.xz/src/hlr_vty.c
Changed
@@ -26,9 +26,12 @@ */ #include <errno.h> +#include <string.h> #include <osmocom/core/talloc.h> #include <osmocom/gsm/protocol/gsm_04_08_gprs.h> +#include <osmocom/gsm/apn.h> + #include <osmocom/vty/vty.h> #include <osmocom/vty/stats.h> #include <osmocom/vty/command.h> @@ -103,6 +106,182 @@ return CMD_SUCCESS; } +struct cmd_node ps_node = { + PS_NODE, + "%s(config-hlr-ps)# ", + 1, +}; + +DEFUN(cfg_ps, + cfg_ps_cmd, + "ps", + "Configure the PS options") +{ + vty->node = PS_NODE; + return CMD_SUCCESS; +} + +struct cmd_node ps_pdp_profiles_node = { + PS_PDP_PROFILES_NODE, + "%s(config-hlr-ps-pdp-profiles)# ", + 1, +}; + +DEFUN(cfg_ps_pdp_profiles, + cfg_ps_pdp_profiles_cmd, + "pdp-profiles default", + "Define a PDP profile set.\n" + "Define the global default profile.\n") +{ + g_hlr->ps.pdp_profile.enabled = true; + + vty->node = PS_PDP_PROFILES_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ps_pdp_profiles, + cfg_no_ps_pdp_profiles_cmd, + "no pdp-profiles default", + NO_STR + "Delete PDP profile.\n" + "Unique identifier for this PDP profile set.\n") +{ + g_hlr->ps.pdp_profile.enabled = false; + return CMD_SUCCESS; +} + + + +struct cmd_node ps_pdp_profiles_profile_node = { + PS_PDP_PROFILES_PROFILE_NODE, + "%s(config-hlr-ps-pdp-profile)# ", + 1, +}; + + +/* context_id == 0 means the slot is free */ +struct osmo_gsup_pdp_info *get_pdp_profile(uint8_t context_id) +{ + for (int i = 0; i < OSMO_GSUP_MAX_NUM_PDP_INFO; i++) { + struct osmo_gsup_pdp_info *info = &g_hlr->ps.pdp_profile.pdp_infosi; + if (info->context_id == context_id) + return info; + } + + return NULL; +} + +struct osmo_gsup_pdp_info *create_pdp_profile(uint8_t context_id) +{ + struct osmo_gsup_pdp_info *info = get_pdp_profile(0); + if (!info) + return NULL; + + memset(info, 0, sizeof(*info)); + info->context_id = context_id; + info->have_info = 1; + + g_hlr->ps.pdp_profile.num_pdp_infos++; + return info; +} + +void destroy_pdp_profile(struct osmo_gsup_pdp_info *info) +{ + info->context_id = 0; + if (info->apn_enc) + talloc_free((void *) info->apn_enc); + + g_hlr->ps.pdp_profile.num_pdp_infos--; + memset(info, 0, sizeof(*info)); +} + +DEFUN(cfg_ps_pdp_profiles_profile, + cfg_ps_pdp_profiles_profile_cmd, + "profile <1-10>", + "Configure a PDP profile\n" + "Unique PDP context identifier. The lowest profile will be used as default context.\n") +{ + struct osmo_gsup_pdp_info *info; + uint8_t context_id = atoi(argv0); + + info = get_pdp_profile(context_id); + if (!info) { + info = create_pdp_profile(context_id); + if (!info) { + vty_out(vty, "Failed to create profile %d!%s", context_id, VTY_NEWLINE); + return CMD_ERR_INCOMPLETE; + } + } + + vty->node = PS_PDP_PROFILES_PROFILE_NODE; + vty->index = info; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ps_pdp_profiles_profile, + cfg_no_ps_pdp_profiles_profile_cmd, + "no profile <1-10>", + NO_STR + "Delete a PDP profile\n" + "Unique PDP context identifier. The lowest profile will be used as default context.\n") +{ + struct osmo_gsup_pdp_info *info; + uint8_t context_id = atoi(argv0); + + info = get_pdp_profile(context_id); + if (info) + destroy_pdp_profile(info); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ps_pdp_profile_apn, cfg_ps_pdp_profile_apn_cmd, + "apn ID", + "Configure the APN.\n" + "APN name or * for wildcard apn.\n") +{ + struct osmo_gsup_pdp_info *info = vty->index; + const char *apn_name = argv0; + + /* apn encoded takes one more byte than strlen() */ + size_t apn_enc_len = strlen(apn_name) + 1; + uint8_t *apn_enc; + int ret; + + if (apn_enc_len > APN_MAXLEN) { + vty_out(vty, "APN name is too long '%s'. Max is %d!%s", apn_name, APN_MAXLEN, VTY_NEWLINE); + return CMD_ERR_INCOMPLETE; + } + + info->apn_enc = apn_enc = (uint8_t *) talloc_zero_size(g_hlr, apn_enc_len); + ret = info->apn_enc_len = osmo_apn_from_str(apn_enc, apn_enc_len, apn_name); + if (ret < 0) { + talloc_free(apn_enc); + info->apn_enc = NULL; + info->apn_enc_len = 0; + vty_out(vty, "Invalid APN name %s!", apn_name); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ps_pdp_profile_apn, cfg_no_ps_pdp_profile_apn_cmd, + "no apn", + NO_STR + "Delete the APN.\n") +{ + struct osmo_gsup_pdp_info *info = vty->index; + if (info->apn_enc) { + talloc_free((void *) info->apn_enc); + info->apn_enc = NULL; + info->apn_enc_len = 0; + } + + return CMD_SUCCESS; +} + + static int config_write_hlr(struct vty *vty) { vty_out(vty, "hlr%s", VTY_NEWLINE); @@ -149,6 +328,37 @@ return CMD_SUCCESS; }
View file
osmo-hlr_1.6.2.tar.xz/src/hlr_vty_subscr.c -> osmo-hlr_1.7.0.tar.xz/src/hlr_vty_subscr.c
Changed
@@ -1,5 +1,5 @@ /* OsmoHLR subscriber management VTY implementation */ -/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> +/* (C) 2017-2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -77,8 +77,8 @@ static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) { int rc; - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); @@ -137,12 +137,12 @@ if (aud2g.type != OSMO_AUTH_TYPE_NONE && aud2g.type != OSMO_AUTH_TYPE_GSM) { vty_out(vty, "%% Error: 2G auth data is not of type 'GSM'%s", VTY_NEWLINE); - aud2g = (struct osmo_sub_auth_data){}; + aud2g = (struct osmo_sub_auth_data2){}; } if (aud3g.type != OSMO_AUTH_TYPE_NONE && aud3g.type != OSMO_AUTH_TYPE_UMTS) { vty_out(vty, "%% Error: 3G auth data is not of type 'UMTS'%s", VTY_NEWLINE); - aud3g = (struct osmo_sub_auth_data){}; + aud3g = (struct osmo_sub_auth_data2){}; } if (aud2g.algo != OSMO_AUTH_ALG_NONE && aud2g.type != OSMO_AUTH_TYPE_NONE) { @@ -154,9 +154,10 @@ if (aud3g.algo != OSMO_AUTH_ALG_NONE && aud3g.type != OSMO_AUTH_TYPE_NONE) { vty_out(vty, " 3G auth: %s%s", osmo_auth_alg_name(aud3g.algo), VTY_NEWLINE); - vty_out(vty, " K=%s%s", hexdump_buf(aud3g.u.umts.k), VTY_NEWLINE); + vty_out(vty, " K=%s%s", + osmo_hexdump_nospc(aud3g.u.umts.k, aud3g.u.umts.k_len), VTY_NEWLINE); vty_out(vty, " %s=%s%s", aud3g.u.umts.opc_is_op? "OP" : "OPC", - hexdump_buf(aud3g.u.umts.opc), VTY_NEWLINE); + osmo_hexdump_nospc(aud3g.u.umts.opc, aud3g.u.umts.opc_len), VTY_NEWLINE); vty_out(vty, " IND-bitlen=%u", aud3g.u.umts.ind_bitlen); if (aud3g.u.umts.sqn) vty_out(vty, " last-SQN=%"PRIu64, aud3g.u.umts.sqn); @@ -460,20 +461,27 @@ return false; } -#define AUTH_ALG_TYPES_2G "(comp128v1|comp128v2|comp128v3|xor)" +#define AUTH_ALG_TYPES_2G "(comp128v1|comp128v2|comp128v3|xor-2g)" #define AUTH_ALG_TYPES_2G_HELP \ "Use COMP128v1 algorithm\n" \ "Use COMP128v2 algorithm\n" \ "Use COMP128v3 algorithm\n" \ - "Use XOR algorithm\n" + "Use XOR-2G algorithm\n" -#define AUTH_ALG_TYPES_3G "milenage" +#define AUTH_ALG_TYPES_3G "(milenage|tuak)" #define AUTH_ALG_TYPES_3G_HELP \ - "Use Milenage algorithm\n" + "Use Milenage algorithm\n" \ + "Use TUAK algorithm\n" bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo, - int *minlen, int *maxlen) + int *minlen, int *maxlen, int *minlen_opc, int *maxlen_opc) { + /* Default: no OPc. True for all 2G algorithms, and 3G-XOR. Overridden below for real 3G AKA algorithms. */ + if (minlen_opc) + *minlen_opc = 0; + if (maxlen_opc) + *maxlen_opc = 0; + if (!strcasecmp(alg_str, "none")) { *algo = OSMO_AUTH_ALG_NONE; *minlen = *maxlen = 0; @@ -486,13 +494,28 @@ } else if (!strcasecmp(alg_str, "comp128v3")) { *algo = OSMO_AUTH_ALG_COMP128v3; *minlen = *maxlen = A38_COMP128_KEY_LEN; - } else if (!strcasecmp(alg_str, "xor")) { - *algo = OSMO_AUTH_ALG_XOR; + } else if (!strcasecmp(alg_str, "xor-3g")) { + *algo = OSMO_AUTH_ALG_XOR_3G; *minlen = A38_XOR_MIN_KEY_LEN; *maxlen = A38_XOR_MAX_KEY_LEN; + } else if (!strcasecmp(alg_str, "xor-2g")) { + *algo = OSMO_AUTH_ALG_XOR_2G; + *minlen = *maxlen = A38_XOR2G_KEY_LEN; } else if (!strcasecmp(alg_str, "milenage")) { *algo = OSMO_AUTH_ALG_MILENAGE; *minlen = *maxlen = MILENAGE_KEY_LEN; + if (minlen_opc) + *minlen_opc = MILENAGE_KEY_LEN; + if (maxlen_opc) + *maxlen_opc = MILENAGE_KEY_LEN; + } else if (!strcasecmp(alg_str, "tuak")) { + *algo = OSMO_AUTH_ALG_TUAK; + *minlen = 16; + *maxlen = 32; + if (minlen_opc) + *minlen_opc = 32; + if (maxlen_opc) + *maxlen_opc = 32; } else return false; return true; @@ -548,7 +571,7 @@ .u.gsm.ki = ki, }; - if (!auth_algo_parse(alg_type, &aud2g.algo, &minlen, &maxlen)) { + if (!auth_algo_parse(alg_type, &aud2g.algo, &minlen, &maxlen, NULL, NULL)) { vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); return CMD_WARNING; } @@ -607,21 +630,21 @@ SUBSCR_UPDATE_HELP "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" AUTH_ALG_TYPES_3G_HELP - "Set Encryption Key K\n" "K as 32 hexadecimal characters\n" - "Set OP key\n" "Set OPC key\n" "OP or OPC as 32 hexadecimal characters\n" + "Set Encryption Key K\n" "K as 32/64 hexadecimal characters\n" + "Set OP key\n" "Set OPC key\n" "OP or OPC as 32/64 hexadecimal characters\n" "Set IND bit length\n" "IND bit length value (default: 5)\n") { struct hlr_subscriber subscr; - int minlen = 0; - int maxlen = 0; + int minlen = 0, minlen_opc = 0; + int maxlen = 0, maxlen_opc = 0; int rc; const char *id_type = argv0; const char *id = argv1; - const char *alg_type = AUTH_ALG_TYPES_3G; - const char *k = argv2; - bool opc_is_op = (strcasecmp("op", argv3) == 0); - const char *op_opc = argv4; - int ind_bitlen = argc > 6? atoi(argv6) : 5; + const char *alg_type = argv2; + const char *k = argv3; + bool opc_is_op = (strcasecmp("op", argv4) == 0); + const char *op_opc = argv5; + int ind_bitlen = argc > 7 ? atoi(argv7) : 5; struct sub_auth_data_str aud3g = { .type = OSMO_AUTH_TYPE_UMTS, .u.umts = { @@ -632,7 +655,7 @@ }, }; - if (!auth_algo_parse(alg_type, &aud3g.algo, &minlen, &maxlen)) { + if (!auth_algo_parse(alg_type, &aud3g.algo, &minlen, &maxlen, &minlen_opc, &maxlen_opc)) { vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); return CMD_WARNING; } @@ -640,8 +663,7 @@ if (!is_hexkey_valid(vty, "K", aud3g.u.umts.k, minlen, maxlen)) return CMD_WARNING; - if (!is_hexkey_valid(vty, opc_is_op ? "OP" : "OPC", aud3g.u.umts.opc, - MILENAGE_KEY_LEN, MILENAGE_KEY_LEN)) + if (!is_hexkey_valid(vty, opc_is_op ? "OP" : "OPC", aud3g.u.umts.opc, minlen_opc, maxlen_opc)) return CMD_WARNING; if (get_subscr_by_argv(vty, id_type, id, &subscr)) @@ -659,11 +681,11 @@ DEFUN(subscriber_aud3g_xor, subscriber_aud3g_xor_cmd, - SUBSCR_UPDATE "aud3g xor k K" + SUBSCR_UPDATE "aud3g xor-3g k K" " ind-bitlen <0-28>", SUBSCR_UPDATE_HELP "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" - "Use XOR algorithm\n" + "Use XOR-3G algorithm\n" "Set Encryption Key K\n" "K as 32 hexadecimal characters\n" "Set IND bit length\n" "IND bit length value (default: 5)\n") { @@ -685,8 +707,8 @@ }, }; - if (!auth_algo_parse("xor", &aud3g.algo, &minlen, &maxlen)) { - vty_out(vty, "%% Unknown auth algorithm: '%s'%s", "xor", VTY_NEWLINE); + if (!auth_algo_parse("xor-3g", &aud3g.algo, &minlen, &maxlen, NULL, NULL)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", "xor-3g", VTY_NEWLINE); return CMD_WARNING; }
View file
osmo-hlr_1.6.2.tar.xz/src/lu_fsm.c -> osmo-hlr_1.7.0.tar.xz/src/lu_fsm.c
Changed
@@ -241,13 +241,11 @@ struct lu *lu = fi->priv; struct hlr_subscriber *subscr = &lu->subscr; struct osmo_gsup_message gsup; - uint8_t msisdn_encOSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN; - uint8_t apnAPN_MAXLEN; if (osmo_gsup_create_insert_subscriber_data_msg(&gsup, subscr->imsi, - subscr->msisdn, msisdn_enc, sizeof(msisdn_enc), - apn, sizeof(apn), - lu->is_ps? OSMO_GSUP_CN_DOMAIN_PS : OSMO_GSUP_CN_DOMAIN_CS)) { + subscr->msisdn, + lu->is_ps ? OSMO_GSUP_CN_DOMAIN_PS : OSMO_GSUP_CN_DOMAIN_CS, + OTC_SELECT)) { lu_failure(lu, GMM_CAUSE_NET_FAIL, "cannot encode Insert Subscriber Data message"); return; } @@ -277,6 +275,7 @@ case OSMO_GSUP_MSGT_INSERT_DATA_ERROR: lu_failure(lu, GMM_CAUSE_NET_FAIL, "Rx %s", osmo_gsup_message_type_name(req->gsup.message_type)); + osmo_gsup_req_free(req); break; default:
View file
osmo-hlr_1.6.2.tar.xz/src/mslookup/Makefile.am -> osmo-hlr_1.7.0.tar.xz/src/mslookup/Makefile.am
Changed
@@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=1:0:0 +LIBVERSION=1:1:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) $(LIBOSMOCORE_CFLAGS)
View file
osmo-hlr_1.6.2.tar.xz/src/mslookup/osmo-mslookup-client.c -> osmo-hlr_1.7.0.tar.xz/src/mslookup/osmo-mslookup-client.c
Changed
@@ -419,9 +419,9 @@ { struct osmo_fd *ofd = &c->ofd; + osmo_fd_unregister(ofd); close(ofd->fd); ofd->fd = -1; - osmo_fd_unregister(ofd); llist_del(&c->entry); talloc_free(c); @@ -561,9 +561,9 @@ llist_for_each_entry_safe(c, n, &globals.socket_clients, entry) socket_client_close(c); if (osmo_fd_is_registered(&globals.socket_ofd)) { + osmo_fd_unregister(&globals.socket_ofd); close(globals.socket_ofd.fd); globals.socket_ofd.fd = -1; - osmo_fd_unregister(&globals.socket_ofd); } }
View file
osmo-hlr_1.6.2.tar.xz/tests/auc/Makefile.am -> osmo-hlr_1.7.0.tar.xz/tests/auc/Makefile.am
Changed
@@ -2,12 +2,12 @@ AM_CPPFLAGS = \ $(all_includes) \ + -I$(top_srcdir)/include \ $(NULL) AM_CFLAGS = \ -Wall \ -ggdb3 \ - -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(NULL) @@ -30,8 +30,8 @@ $(NULL) auc_test_LDADD = \ - $(top_srcdir)/src/auc.c \ - $(top_srcdir)/src/logging.c \ + $(top_builddir)/src/auc.o \ + $(top_builddir)/src/logging.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(NULL) @@ -41,8 +41,8 @@ $(NULL) auc_ts_55_205_test_sets_LDADD = \ - $(top_srcdir)/src/auc.c \ - $(top_srcdir)/src/logging.c \ + $(top_builddir)/src/auc.o \ + $(top_builddir)/src/logging.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(NULL)
View file
osmo-hlr_1.6.2.tar.xz/tests/auc/auc_test.c -> osmo-hlr_1.7.0.tar.xz/tests/auc/auc_test.c
Changed
@@ -116,14 +116,14 @@ /* Subscriber with 2G-only (COMP128v1) authentication data */ static void test_gen_vectors_2g_only(void) { - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; struct osmo_auth_vector vec; int rc; comment_start(); - aud2g = (struct osmo_sub_auth_data){ + aud2g = (struct osmo_sub_auth_data2){ .type = OSMO_AUTH_TYPE_GSM, .algo = OSMO_AUTH_ALG_COMP128v1, }; @@ -131,7 +131,7 @@ osmo_hexparse("EB215756028D60E3275E613320AEC880", aud2g.u.gsm.ki, sizeof(aud2g.u.gsm.ki)); - aud3g = (struct osmo_sub_auth_data){ 0 }; + aud3g = (struct osmo_sub_auth_data2){ 0 }; next_rand("39fa2f4e3d523d8619a73b4f65c3e14d", true); @@ -179,14 +179,14 @@ * reflects the default configuration of sysmoUSIM-SJS1 */ static void test_gen_vectors_2g_plus_3g(void) { - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; struct osmo_auth_vector vec; int rc; comment_start(); - aud2g = (struct osmo_sub_auth_data){ + aud2g = (struct osmo_sub_auth_data2){ .type = OSMO_AUTH_TYPE_GSM, .algo = OSMO_AUTH_ALG_COMP128v1, }; @@ -194,9 +194,11 @@ osmo_hexparse("EB215756028D60E3275E613320AEC880", aud2g.u.gsm.ki, sizeof(aud2g.u.gsm.ki)); - aud3g = (struct osmo_sub_auth_data){ + aud3g = (struct osmo_sub_auth_data2){ .type = OSMO_AUTH_TYPE_UMTS, .algo = OSMO_AUTH_ALG_MILENAGE, + .u.umts.k_len = 16, + .u.umts.opc_len = 16, .u.umts.sqn = 31, }; @@ -292,8 +294,8 @@ * tuples are suitable for both 2G and 3G authentication */ static void test_gen_vectors_3g_only(void) { - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; struct osmo_auth_vector vec; struct osmo_auth_vector vecs3; uint8_t auts14; @@ -302,11 +304,13 @@ comment_start(); - aud2g = (struct osmo_sub_auth_data){ 0 }; + aud2g = (struct osmo_sub_auth_data2){ 0 }; - aud3g = (struct osmo_sub_auth_data){ + aud3g = (struct osmo_sub_auth_data2){ .type = OSMO_AUTH_TYPE_UMTS, .algo = OSMO_AUTH_ALG_MILENAGE, + .u.umts.k_len = 16, + .u.umts.opc_len = 16, .u.umts.sqn = 31, }; @@ -466,18 +470,20 @@ * 2G and 3G authentication */ static void test_gen_vectors_3g_xor(void) { - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; struct osmo_auth_vector vec; int rc; comment_start(); - aud2g = (struct osmo_sub_auth_data){ 0 }; + aud2g = (struct osmo_sub_auth_data2){ 0 }; - aud3g = (struct osmo_sub_auth_data){ + aud3g = (struct osmo_sub_auth_data2){ .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_XOR, + .algo = OSMO_AUTH_ALG_XOR_3G, + .u.umts.k_len = 16, + .u.umts.opc_len = 16, .u.umts.sqn = 0, }; @@ -517,39 +523,43 @@ int rc; int i; - struct osmo_sub_auth_data aud2g = { + struct osmo_sub_auth_data2 aud2g = { .type = OSMO_AUTH_TYPE_GSM, .algo = OSMO_AUTH_ALG_COMP128v1, }; - struct osmo_sub_auth_data aud3g = { + struct osmo_sub_auth_data2 aud3g = { .type = OSMO_AUTH_TYPE_UMTS, .algo = OSMO_AUTH_ALG_MILENAGE, + .u.umts.k_len = 16, + .u.umts.opc_len = 16, }; - struct osmo_sub_auth_data aud2g_noalg = { + struct osmo_sub_auth_data2 aud2g_noalg = { .type = OSMO_AUTH_TYPE_GSM, .algo = OSMO_AUTH_ALG_NONE, }; - struct osmo_sub_auth_data aud3g_noalg = { + struct osmo_sub_auth_data2 aud3g_noalg = { .type = OSMO_AUTH_TYPE_UMTS, .algo = OSMO_AUTH_ALG_NONE, + .u.umts.k_len = 16, + .u.umts.opc_len = 16, }; - struct osmo_sub_auth_data aud_notype = { + struct osmo_sub_auth_data2 aud_notype = { .type = OSMO_AUTH_TYPE_NONE, .algo = OSMO_AUTH_ALG_MILENAGE, }; - struct osmo_sub_auth_data no_aud = { + struct osmo_sub_auth_data2 no_aud = { .type = OSMO_AUTH_TYPE_NONE, .algo = OSMO_AUTH_ALG_NONE, }; struct { - struct osmo_sub_auth_data *aud2g; - struct osmo_sub_auth_data *aud3g; + struct osmo_sub_auth_data2 *aud2g; + struct osmo_sub_auth_data2 *aud3g; uint8_t *rand_auts; uint8_t *auts; const char *label;
View file
osmo-hlr_1.6.2.tar.xz/tests/auc/gen_ts_55_205_test_sets/func_template.c -> osmo-hlr_1.7.0.tar.xz/tests/auc/gen_ts_55_205_test_sets/func_template.c
Changed
@@ -24,43 +24,46 @@ static void {func_name}(void) {{ - struct osmo_sub_auth_data aud2g; - struct osmo_sub_auth_data aud3g; - struct osmo_auth_vector vec; - int rc; - - comment_start(); - - aud2g = (struct osmo_sub_auth_data){{ 0 }}; - - aud3g = (struct osmo_sub_auth_data){{ - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, + struct osmo_sub_auth_data2 aud2g; + struct osmo_sub_auth_data2 aud3g; + struct osmo_auth_vector vec; + int rc; + + comment_start(); + + aud2g = (struct osmo_sub_auth_data2){{ 0 }}; + + aud3g = (struct osmo_sub_auth_data2){{ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_MILENAGE, + .u.umts.k_len = 16, + .u.umts.opc_len = 16, .u.umts.sqn = 31, - }}; + }}; - osmo_hexparse("{Ki}", - aud3g.u.umts.k, sizeof(aud3g.u.umts.k)); - osmo_hexparse("{OPc}", - aud3g.u.umts.opc, sizeof(aud3g.u.umts.opc)); + osmo_hexparse("{Ki}", + aud3g.u.umts.k, sizeof(aud3g.u.umts.k)); + osmo_hexparse("{OPc}", + aud3g.u.umts.opc, sizeof(aud3g.u.umts.opc)); - osmo_hexparse("{RAND}", - fake_rand, sizeof(fake_rand)); + osmo_hexparse("{RAND}", + fake_rand, sizeof(fake_rand)); - vec = (struct osmo_auth_vector){{ {{0}} }}; + vec = (struct osmo_auth_vector){{ {{0}} }}; + vec.res_len = 8; VERBOSE_ASSERT(aud3g.u.umts.sqn, == 31, "%"PRIu64); - rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); - VERBOSE_ASSERT(rc, == 1, "%d"); + rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); + VERBOSE_ASSERT(rc, == 1, "%d"); VERBOSE_ASSERT(aud3g.u.umts.sqn, == 32, "%"PRIu64); - VEC_IS(&vec, - " rand: {RAND}\n" - " ck: {MIL3G-CK}\n" - " ik: {MIL3G-IK}\n" - " res: {MIL3G-RES}0000000000000000\n" - " kc: {Kc}\n" - " sres: {SRES#1}\n" - ); + VEC_IS(&vec, + " rand: {RAND}\n" + " ck: {MIL3G-CK}\n" + " ik: {MIL3G-IK}\n" + " res: {MIL3G-RES}0000000000000000\n" + " kc: {Kc}\n" + " sres: {SRES#1}\n" + ); comment_end(); }}
View file
osmo-hlr_1.6.2.tar.xz/tests/auc/gen_ts_55_205_test_sets/main_template.c -> osmo-hlr_1.7.0.tar.xz/tests/auc/gen_ts_55_205_test_sets/main_template.c
Changed
@@ -55,7 +55,7 @@ if (pos >= end) \ return buf; \ pos += snprintf(pos, sizeof(buf) - (pos - buf), \ - " " #what ": %s\n", \ + " " #what ": %s\n", \ osmo_hexdump_nospc((void*)&vec->what, sizeof(vec->what))) append(rand); @@ -71,7 +71,7 @@ #define VEC_IS(vec, expect) do { \ char *_is = vec_str(vec); \ - if (strcmp(_is, expect)) { \ + if (strcmp(_is, expect)) { \ fprintf(stderr, "MISMATCH! expected ==\n%s\n", \ expect); \ char *a = _is; \
View file
osmo-hlr_1.6.2.tar.xz/tests/db/Makefile.am -> osmo-hlr_1.7.0.tar.xz/tests/db/Makefile.am
Changed
@@ -1,7 +1,10 @@ -AM_CFLAGS = \ +AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ + $(NULL) + +AM_CFLAGS = \ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \
View file
osmo-hlr_1.6.2.tar.xz/tests/db/db_test.c -> osmo-hlr_1.7.0.tar.xz/tests/db/db_test.c
Changed
@@ -122,16 +122,16 @@ /* Not linking the real auc_compute_vectors(), just returning num_vec. * This gets called by db_get_auc(), but we're only interested in its rc. */ int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, - struct osmo_sub_auth_data *aud2g, - struct osmo_sub_auth_data *aud3g, + struct osmo_sub_auth_data2 *aud2g, + struct osmo_sub_auth_data2 *aud3g, const uint8_t *rand_auts, const uint8_t *auts) { return num_vec; } static struct db_context *dbc = NULL; static void *ctx = NULL; static struct hlr_subscriber g_subscr; -static struct osmo_sub_auth_data g_aud2g; -static struct osmo_sub_auth_data g_aud3g; +static struct osmo_sub_auth_data2 g_aud2g; +static struct osmo_sub_auth_data2 g_aud3g; static int g_rc; static int64_t g_id; @@ -180,18 +180,21 @@ #undef Pb } -void dump_aud(const char *label, struct osmo_sub_auth_data *aud) +void dump_aud(const char *label, struct osmo_sub_auth_data2 *aud) { if (aud->type == OSMO_AUTH_TYPE_NONE) { fprintf(stderr, "%s: none\n", label); return; } - fprintf(stderr, "%s: struct osmo_sub_auth_data {\n", label); + fprintf(stderr, "%s: struct osmo_sub_auth_data2 {\n", label); #define Pf(name, fmt) \ Pfo(name, fmt, aud) #define Phex(name) \ Pfv(name, "'%s'", osmo_hexdump_nospc(aud->name, sizeof(aud->name))) +#define Phexl(name, len) \ + Pfv(name, "'%s'", osmo_hexdump_nospc(aud->name, aud->len)) + Pfv(type, "%s", osmo_sub_auth_type_name(aud->type)); Pfv(algo, "%s", osmo_auth_alg_name(aud->algo)); @@ -200,9 +203,9 @@ Phex(u.gsm.ki); break; case OSMO_AUTH_TYPE_UMTS: - Phex(u.umts.opc); + Phexl(u.umts.opc, u.umts.opc_len); Pf(u.umts.opc_is_op, "%u"); - Phex(u.umts.k); + Phexl(u.umts.k, u.umts.k_len); Phex(u.umts.amf); if (aud->u.umts.sqn) { Pf(u.umts.sqn, "%"PRIu64); @@ -219,6 +222,7 @@ #undef Pf #undef Phex +#undef Phexl } void db_raw_sql(struct db_context *dbc, const char *sql) @@ -586,7 +590,7 @@ ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, - mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "CededEffacedAceFacedBadFadedBeef")), 0); ASSERT_SEL_AUD(imsi0, 0, id); @@ -604,7 +608,7 @@ -ENOENT); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, - mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "CededEffacedAceFacedBadFadedBeef")), 0); ASSERT_SEL_AUD(imsi0, 0, id); @@ -707,12 +711,12 @@ ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, - mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), + mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "f000000000000f00000000000f000000f00000000")), -EINVAL); ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, - mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), + mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "f00")), -EINVAL); ASSERT_SEL_AUD(imsi0, 0, id);
View file
osmo-hlr_1.6.2.tar.xz/tests/db/db_test.err -> osmo-hlr_1.7.0.tar.xz/tests/db/db_test.err
Changed
@@ -824,7 +824,7 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v1, .u.gsm.ki = '0123456789abcdef0123456789abcdef', @@ -841,7 +841,7 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v1, .u.gsm.ki = '0123456789abcdef0123456789abcdef', @@ -853,7 +853,7 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v2, .u.gsm.ki = 'beadedbeeaced1ebbeddefacedfacade', @@ -865,21 +865,21 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v3, .u.gsm.ki = 'deafbeddedbabeacceededfadeddecaf', } 3G: none -db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "CededEffacedAceFacedBadFadedBeef")) --> 0 db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, - .algo = XOR, + .algo = XOR-2G, .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', } 3G: none @@ -900,14 +900,14 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> -ENOENT -db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "CededEffacedAceFacedBadFadedBeef")) --> 0 db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, - .algo = XOR, + .algo = XOR-2G, .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', } 3G: none @@ -932,7 +932,7 @@ DAUC IMSI='123456789000000': No 2G Auth Data 2G: none -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -954,7 +954,7 @@ DAUC IMSI='123456789000000': No 2G Auth Data 2G: none -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -970,7 +970,7 @@ DAUC IMSI='123456789000000': No 2G Auth Data 2G: none -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'deaf0ff1ced0d0dabbedd1ced1cef00d', @@ -985,7 +985,7 @@ DAUC IMSI='123456789000000': No 2G Auth Data 2G: none -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -1001,7 +1001,7 @@ DAUC IMSI='123456789000000': No 2G Auth Data 2G: none -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', @@ -1033,7 +1033,7 @@ DAUC IMSI='123456789000000': No 2G Auth Data 2G: none -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', @@ -1069,12 +1069,12 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v3, .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', } -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -1097,12 +1097,12 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v3, .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', } -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -1112,17 +1112,17 @@ .u.umts.ind_bitlen = 5, } -db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "f000000000000f00000000000f000000f00000000")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v3, .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', } -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -1132,17 +1132,17 @@ .u.umts.ind_bitlen = 5, } -db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR_2G, "f00")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f00' db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 -2G: struct osmo_sub_auth_data { +2G: struct osmo_sub_auth_data2 { .type = GSM, .algo = COMP128v3, .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', } -3G: struct osmo_sub_auth_data { +3G: struct osmo_sub_auth_data2 { .type = UMTS, .algo = MILENAGE, .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', @@ -1157,12 +1157,12 @@ db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0
View file
osmo-hlr_1.6.2.tar.xz/tests/db_upgrade/create_subscribers.vty -> osmo-hlr_1.7.0.tar.xz/tests/db_upgrade/create_subscribers.vty
Changed
@@ -43,5 +43,5 @@ MSISDN: none OsmoHLR# subscriber imsi 5555555 update msisdn 55555555555555 % Updated subscriber IMSI='5555555' to MSISDN='55555555555555' -OsmoHLR# subscriber imsi 5555555 update aud2g xor ki 55555555555555555555555555555555 +OsmoHLR# subscriber imsi 5555555 update aud2g xor-2g ki 55555555555555555555555555555555 OsmoHLR# subscriber imsi 5555555 update aud3g milenage k 55555555555555555555555555555555 opc 55555555555555555555555555555555
View file
osmo-hlr_1.6.2.tar.xz/tests/db_upgrade/db_upgrade_test.ok -> osmo-hlr_1.7.0.tar.xz/tests/db_upgrade/db_upgrade_test.ok
Changed
@@ -12,7 +12,7 @@ algo_id_2g|ki|subscriber_id 1|BeefedCafeFaceAcedAddedDecadeFee|1 2|33333333333333333333333333333333|4 -4|55555555555555555555555555555555|6 +6|55555555555555555555555555555555|6 Table: auc_3g name|type|notnull|dflt_value|pk @@ -86,6 +86,7 @@ DDB Database <PATH>test.db' has been upgraded to HLR DB schema version 4 DDB Database <PATH>test.db' has been upgraded to HLR DB schema version 5 DDB Database <PATH>test.db' has been upgraded to HLR DB schema version 6 +DDB Database <PATH>test.db' has been upgraded to HLR DB schema version 7 DMAIN Cmdline option --db-check: Database was opened successfully, quitting. Resulting db: @@ -100,15 +101,15 @@ algo_id_2g|ki|subscriber_id 1|BeefedCafeFaceAcedAddedDecadeFee|1 2|33333333333333333333333333333333|4 -4|55555555555555555555555555555555|6 +6|55555555555555555555555555555555|6 Table: auc_3g name|type|notnull|dflt_value|pk algo_id_3g|INTEGER|1||0 ind_bitlen|INTEGER|1|5|0 -k|VARCHAR(32)|1||0 -op|VARCHAR(32)|0||0 -opc|VARCHAR(32)|0||0 +k|VARCHAR(64)|1||0 +op|VARCHAR(64)|0||0 +opc|VARCHAR(64)|0||0 sqn|INTEGER|1|0|0 subscriber_id|INTEGER|0||1 @@ -179,5 +180,5 @@ rc = 0 DMAIN hlr starting DDB using database: <PATH>test.db -DDB Database <PATH>test.db' has HLR DB schema version 6 +DDB Database <PATH>test.db' has HLR DB schema version 7 DMAIN Cmdline option --db-check: Database was opened successfully, quitting.
View file
osmo-hlr_1.6.2.tar.xz/tests/db_upgrade/hlr_db_v0.sql -> osmo-hlr_1.7.0.tar.xz/tests/db_upgrade/hlr_db_v0.sql
Changed
@@ -61,7 +61,7 @@ ); INSERT INTO auc_2g VALUES(1,1,'BeefedCafeFaceAcedAddedDecadeFee'); INSERT INTO auc_2g VALUES(4,2,'33333333333333333333333333333333'); -INSERT INTO auc_2g VALUES(6,4,'55555555555555555555555555555555'); +INSERT INTO auc_2g VALUES(6,6,'55555555555555555555555555555555'); CREATE TABLE auc_3g ( subscriber_id INTEGER PRIMARY KEY, -- subscriber.id algo_id_3g INTEGER NOT NULL, -- enum osmo_auth_algo value
View file
osmo-hlr_1.6.2.tar.xz/tests/gsup/Makefile.am -> osmo-hlr_1.7.0.tar.xz/tests/gsup/Makefile.am
Changed
@@ -1,9 +1,9 @@ AM_CPPFLAGS = \ $(all_includes) \ + -I$(top_srcdir)/include \ $(NULL) AM_CFLAGS = \ - -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(NULL)
View file
osmo-hlr_1.6.2.tar.xz/tests/mslookup/Makefile.am -> osmo-hlr_1.7.0.tar.xz/tests/mslookup/Makefile.am
Changed
@@ -1,11 +1,11 @@ AM_CPPFLAGS = \ $(all_includes) \ + -I$(top_srcdir)/include \ $(NULL) AM_CFLAGS = \ -Wall \ -ggdb3 \ - -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \
View file
osmo-hlr_1.6.2.tar.xz/tests/test_nodes.vty -> osmo-hlr_1.7.0.tar.xz/tests/test_nodes.vty
Changed
@@ -53,6 +53,7 @@ OsmoHLR(config-hlr)# list ... gsup + ps database PATH euse NAME no euse NAME @@ -112,6 +113,12 @@ ipa-name unnamed-HLR ussd route prefix *#100# internal own-msisdn ussd route prefix *#101# internal own-imsi + ps + pdp-profiles default + profile 1 + apn internet + profile 2 + apn * end OsmoHLR# configure terminal @@ -448,3 +455,44 @@ client mdns bind 239.192.23.42 4266 ... +OsmoHLR(config-mslookup-server)# end +OsmoHLR# configure terminal + +OsmoHLR(config)# hlr +OsmoHLR(config-hlr)# ps? + ps Configure the PS options + +OsmoHLR(config-hlr)# ps + +OsmoHLR(config-hlr-ps)# list +... + pdp-profiles default + no pdp-profiles default +... +OsmoHLR(config-hlr-ps)# no pdp-profiles default + + +OsmoHLR(config-hlr-ps)# pdp-profiles default +OsmoHLR(config-hlr-ps-pdp-profiles)# ? +... + profile Configure a PDP profile +... +OsmoHLR(config-hlr-ps-pdp-profiles)# profile 1 + +OsmoHLR(config-hlr-ps-pdp-profile)# ? +... + apn Configure the APN. +... +OsmoHLR(config-hlr-ps-pdp-profile)# apn internet +OsmoHLR(config-hlr-ps-pdp-profile)# exit +OsmoHLR(config-hlr-ps-pdp-profiles)# profile 2 +OsmoHLR(config-hlr-ps-pdp-profile)# apn * +OsmoHLR(config-hlr-ps-pdp-profile)# show running-config +... + ps + pdp-profiles default + profile 1 + apn internet + profile 2 + apn * +...
View file
osmo-hlr_1.6.2.tar.xz/tests/test_subscriber.ctrl -> osmo-hlr_1.7.0.tar.xz/tests/test_subscriber.ctrl
Changed
@@ -674,9 +674,12 @@ GET 112 subscriber.by-imsi-901991234567891.aud2g GET_REPLY 112 subscriber.by-imsi-901991234567891.aud2g none -SET 113 subscriber.by-imsi-901991234567891.aud2g xor,c01ffedc1cadaeac1d1f1edacac1ab0a +SET 113 subscriber.by-imsi-901991234567891.aud2g xor-2g,c01ffedc1cadaeac1d1f1edacac1ab0a SET_REPLY 113 subscriber.by-imsi-901991234567891.aud2g OK +GET 114 subscriber.by-imsi-901991234567891.aud2g +GET_REPLY 114 subscriber.by-imsi-901991234567891.aud2g XOR-2G,c01ffedc1cadaeac1d1f1edacac1ab0a + SET 115 subscriber.by-imsi-901991234567891.aud2g none SET_REPLY 115 subscriber.by-imsi-901991234567891.aud2g OK
View file
osmo-hlr_1.6.2.tar.xz/tests/test_subscriber.vty -> osmo-hlr_1.7.0.tar.xz/tests/test_subscriber.vty
Changed
@@ -8,10 +8,10 @@ subscriber (imsi|msisdn|id|imei) IDENT delete subscriber (imsi|msisdn|id|imei) IDENT update msisdn (none|MSISDN) subscriber (imsi|msisdn|id|imei) IDENT update aud2g none - subscriber (imsi|msisdn|id|imei) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor) ki KI + subscriber (imsi|msisdn|id|imei) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor-2g) ki KI subscriber (imsi|msisdn|id|imei) IDENT update aud3g none - subscriber (imsi|msisdn|id|imei) IDENT update aud3g milenage k K (op|opc) OP_C ind-bitlen <0-28> - subscriber (imsi|msisdn|id|imei) IDENT update aud3g xor k K ind-bitlen <0-28> + subscriber (imsi|msisdn|id|imei) IDENT update aud3g (milenage|tuak) k K (op|opc) OP_C ind-bitlen <0-28> + subscriber (imsi|msisdn|id|imei) IDENT update aud3g xor-3g k K ind-bitlen <0-28> subscriber (imsi|msisdn|id|imei) IDENT update imei (none|IMEI) subscriber (imsi|msisdn|id|imei) IDENT update network-access-mode (none|cs|ps|cs+ps) show mslookup services @@ -144,7 +144,7 @@ comp128v1 Use COMP128v1 algorithm comp128v2 Use COMP128v2 algorithm comp128v3 Use COMP128v3 algorithm - xor Use XOR algorithm + xor-2g Use XOR-2G algorithm OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ? ki Set Ki Encryption Key @@ -155,12 +155,12 @@ OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki val ? <cr> -OsmoHLR# subscriber imsi 123456789023000 update aud2g xor ki Deaf0ff1ceD0d0DabbedD1ced1ceF00d +OsmoHLR# subscriber imsi 123456789023000 update aud2g xor-2g ki Deaf0ff1ceD0d0DabbedD1ced1ceF00d OsmoHLR# subscriber imsi 123456789023000 show ID: 101 IMSI: 123456789023000 MSISDN: 423 -... + 2G auth: XOR-2G KI=deaf0ff1ced0d0dabbedd1ced1cef00d OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki BeefedCafeFaceAcedAddedDecadeFee @@ -241,7 +241,7 @@ 2G auth: COMP128v3 KI=c01ffedc1cadaeac1d1f1edacac1ab0a -OsmoHLR# subscriber id 101 update aud2g xor ki CoiffedCicadaeAcidifiedAcaciaBoa +OsmoHLR# subscriber id 101 update aud2g xor-2g ki CoiffedCicadaeAcidifiedAcaciaBoa % Invalid value for KI: 'CoiffedCicadaeAcidifiedAcaciaBoa' OsmoHLR# subscriber id 101 show ID: 101 @@ -250,7 +250,7 @@ 2G auth: COMP128v3 KI=c01ffedc1cadaeac1d1f1edacac1ab0a -OsmoHLR# subscriber id 101 update aud2g xor ki C01ffedC1cadaeAc1d1f1edAcac1aB0aX +OsmoHLR# subscriber id 101 update aud2g xor-2g ki C01ffedC1cadaeAc1d1f1edAcac1aB0aX % Invalid value for KI: 'C01ffedC1cadaeAc1d1f1edAcac1aB0aX' OsmoHLR# subscriber id 101 show ID: 101 @@ -269,20 +269,21 @@ OsmoHLR# subscriber imsi 123456789023000 update aud3g ? none Delete 3G authentication data milenage Use Milenage algorithm - xor Use XOR algorithm + tuak Use TUAK algorithm + xor-3g Use XOR-3G algorithm OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage ? k Set Encryption Key K OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k ? - K K as 32 hexadecimal characters + K K as 32/64 hexadecimal characters OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d ? op Set OP key opc Set OPC key OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc ? - OP_C OP or OPC as 32 hexadecimal characters + OP_C OP or OPC as 32/64 hexadecimal characters OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ? ind-bitlen Set IND bit length
View file
osmo-hlr_1.6.2.tar.xz/tests/test_subscriber_errors.ctrl -> osmo-hlr_1.7.0.tar.xz/tests/test_subscriber_errors.ctrl
Changed
@@ -130,7 +130,7 @@ SET 55 subscriber.by-imsi-901990000000003.aud2g foobar,2134 ERROR 55 Unknown auth algorithm. -SET 56 subscriber.by-imsi-901990000000003.aud2g xor,2134 +SET 56 subscriber.by-imsi-901990000000003.aud2g xor-2g,2134 ERROR 56 Invalid KI. SET 57 subscriber.by-imsi-901990000000003.aud3g foobar @@ -139,17 +139,17 @@ SET 58 subscriber.by-imsi-901990000000003.aud3g foobar,2134 ERROR 58 Unknown auth algorithm. -SET 60 subscriber.by-imsi-901990000000003.aud3g milenage,2134 -ERROR 60 Invalid KI. +SET 59 subscriber.by-imsi-901990000000003.aud3g milenage,2134 +ERROR 59 Invalid KI. -SET 61 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,AAA -ERROR 61 Invalid format. +SET 60 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,AAA +ERROR 60 Invalid format. -SET 62 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,OPC -ERROR 62 Invalid format. +SET 61 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,OPC +ERROR 61 Invalid format. -SET 63 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,OPC,zzz -ERROR 63 Invalid OP/OPC. +SET 62 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,OPC,zzz +ERROR 62 Invalid OP/OPC. -SET 64 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,OPC,fb2a3d1b360f599abab99db8669f8308, -ERROR 64 Invalid format. +SET 63 subscriber.by-imsi-901990000000003.aud3g milenage,c01ffedc1cadaeac1d1f1edacac1ab0a,OPC,fb2a3d1b360f599abab99db8669f8308, +ERROR 63 Invalid format.
View file
osmo-hlr_1.6.2.tar.xz/tests/testsuite.at -> osmo-hlr_1.7.0.tar.xz/tests/testsuite.at
Changed
@@ -27,12 +27,7 @@ cat $abs_srcdir/db/db_test.ok > expout cat $abs_srcdir/db/db_test.err > experr sqlite3 db_test.db < $abs_top_srcdir/sql/hlr.sql - -# Compatibility with libosmocore I446e54d0ddf4a18c46ee022b1249af73552e3ce1 -$abs_top_builddir/tests/db/db_test >out 2>err -sed -i "s/XOR-3G,/XOR,/g" err - -AT_CHECK(cat out; cat err >&2, , expout, experr) +AT_CHECK($abs_top_builddir/tests/db/db_test, , expout, experr) AT_CLEANUP # AT_SKIP_IF: disable for old sqlite versions, because the way we dump tables in the test doesn't work with it.
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.