Projects
osmocom:master
osmo-hlr
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 25
View file
osmo-hlr.spec
Changed
@@ -15,13 +15,13 @@ Name: osmo-hlr Requires: osmocom-master -Version: 1.6.0.17.5800 +Version: 1.6.0.19.7a76 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.0.17.5800.tar.xz +Source: osmo-hlr_1.6.0.19.7a76.tar.xz Source1: rpmlintrc BuildRequires: autoconf BuildRequires: automake
View file
commit_5800f3add5d158be31017233ba286f3ca148f743.txt
Deleted
View file
commit_7a763aa0128b7a171b1ca56eea664c66dad4bf4c.txt
Added
View file
osmo-hlr_1.6.0.17.5800.dsc
Deleted
@@ -1,26 +0,0 @@ -Format: 3.0 (native) -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.0.17.5800 -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 (>= 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), libsqlite3-dev, sqlite3, osmo-gsm-manuals-dev (>= 1.4.0) -Package-List: - libosmo-gsup-client-dev deb net optional arch=any - libosmo-gsup-client0 deb libs optional arch=any - libosmo-mslookup-dev deb net optional arch=any - libosmo-mslookup1 deb libs optional arch=any - osmo-hlr deb net optional arch=any - osmo-hlr-dbg deb debug extra arch=any - osmo-hlr-doc deb doc optional arch=all - osmo-mslookup-utils deb utils optional arch=any -Checksums-Sha1: - 124e23527a1697b718710c9bd939be0017c2b180 172652 osmo-hlr_1.6.0.17.5800.tar.xz -Checksums-Sha256: - b9ae2aa488f5673589c87471be7fb5acd62b4bfbde35079bc6bd8105fec5e4ec 172652 osmo-hlr_1.6.0.17.5800.tar.xz -Files: - 9aa2ed0a016610ddc2cd0ab0e1b44555 172652 osmo-hlr_1.6.0.17.5800.tar.xz
View file
osmo-hlr_1.6.0.19.7a76.dsc
Added
@@ -0,0 +1,26 @@ +Format: 3.0 (native) +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.0.19.7a76 +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 (>= 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), libsqlite3-dev, sqlite3, osmo-gsm-manuals-dev (>= 1.4.0) +Package-List: + libosmo-gsup-client-dev deb net optional arch=any + libosmo-gsup-client0 deb libs optional arch=any + libosmo-mslookup-dev deb net optional arch=any + libosmo-mslookup1 deb libs optional arch=any + osmo-hlr deb net optional arch=any + osmo-hlr-dbg deb debug extra arch=any + osmo-hlr-doc deb doc optional arch=all + osmo-mslookup-utils deb utils optional arch=any +Checksums-Sha1: + b2f5ac3b409ac09d7ba22de59d0d2abdb697fa15 173112 osmo-hlr_1.6.0.19.7a76.tar.xz +Checksums-Sha256: + 49f6911f17737ad75b1b09a75d200e56e32333f0bf0cbd73146e5a96b44651fd 173112 osmo-hlr_1.6.0.19.7a76.tar.xz +Files: + 72ad2debeffd420803556c12c08264f2 173112 osmo-hlr_1.6.0.19.7a76.tar.xz
View file
osmo-hlr_1.6.0.17.5800.tar.xz/.tarball-version -> osmo-hlr_1.6.0.19.7a76.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.6.0.17-5800 +1.6.0.19-7a76
View file
osmo-hlr_1.6.0.17.5800.tar.xz/TODO-RELEASE -> osmo-hlr_1.6.0.19.7a76.tar.xz/TODO-RELEASE
Changed
@@ -7,4 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmogsm UPDATE_DEP_VER update libosmogsm version dependency after Ie775fedba4a3fa12314c0f7c8a369662ef6a40df is released +libosmogsm UPDATE_DEP_VER update libosmogsm version dependency after Ib905b8d8bdf248e8299bf50666ee1bca8298433d is released
View file
osmo-hlr_1.6.0.17.5800.tar.xz/debian/changelog -> osmo-hlr_1.6.0.19.7a76.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hlr (1.6.0.17.5800) unstable; urgency=medium +osmo-hlr (1.6.0.19.7a76) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Fri, 21 Jul 2023 12:56:28 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Tue, 29 Aug 2023 13:46:16 +0000 osmo-hlr (1.6.0) unstable; urgency=medium
View file
osmo-hlr_1.6.0.17.5800.tar.xz/sql/hlr.sql -> osmo-hlr_1.6.0.19.7a76.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.0.17.5800.tar.xz/src/ctrl.c -> osmo-hlr_1.6.0.19.7a76.tar.xz/src/ctrl.c
Changed
@@ -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)) @@ -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; } @@ -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.0.17.5800.tar.xz/src/db.c -> osmo-hlr_1.6.0.19.7a76.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," \ @@ -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.0.17.5800.tar.xz/src/db_hlr.c -> osmo-hlr_1.6.0.19.7a76.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 * @@ -286,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.0.17.5800.tar.xz/src/hlr_vty_subscr.c -> osmo-hlr_1.6.0.19.7a76.tar.xz/src/hlr_vty_subscr.c
Changed
@@ -468,13 +468,20 @@ "Use COMP128v3 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; @@ -497,6 +504,18 @@ } 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; @@ -552,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; } @@ -611,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 = { @@ -636,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; } @@ -644,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)) @@ -689,7 +707,7 @@ }, }; - if (!auth_algo_parse("xor-3g", &aud3g.algo, &minlen, &maxlen)) { + 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.0.17.5800.tar.xz/tests/db_upgrade/db_upgrade_test.ok -> osmo-hlr_1.6.0.19.7a76.tar.xz/tests/db_upgrade/db_upgrade_test.ok
Changed
@@ -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: @@ -106,9 +107,9 @@ 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.0.17.5800.tar.xz/tests/test_subscriber.vty -> osmo-hlr_1.6.0.19.7a76.tar.xz/tests/test_subscriber.vty
Changed
@@ -10,7 +10,7 @@ subscriber (imsi|msisdn|id|imei) IDENT update aud2g none 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 (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) @@ -269,20 +269,21 @@ OsmoHLR# subscriber imsi 123456789023000 update aud3g ? none Delete 3G authentication data milenage Use Milenage 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
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
.