mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr.git
synced 2025-10-26 09:43:46 +00:00
Compare commits
4 Commits
osmith/fix
...
1.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f092daa64 | ||
|
|
3868e2389b | ||
|
|
f806e0fa34 | ||
|
|
3a66698d87 |
@@ -34,10 +34,10 @@ PKG_PROG_PKG_CONFIG([0.20])
|
||||
|
||||
PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1])
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.6.0)
|
||||
|
||||
PKG_CHECK_MODULES(SQLITE3, sqlite3)
|
||||
|
||||
52
debian/changelog
vendored
52
debian/changelog
vendored
@@ -1,3 +1,55 @@
|
||||
osmo-hlr (1.2.1) unstable; urgency=medium
|
||||
|
||||
[ Neels Hofmeyr ]
|
||||
* test_nodes.vty: remove cruft
|
||||
|
||||
[ Harald Welte ]
|
||||
* support the XOR algorithm for UMTS AKA
|
||||
|
||||
-- Harald Welte <laforge@osmocom.org> Tue, 29 Dec 2020 20:39:53 +0100
|
||||
|
||||
osmo-hlr (1.2.0) unstable; urgency=medium
|
||||
|
||||
[ Ruben Undheim ]
|
||||
* Fix test for return codes on mipsel and alpha archs
|
||||
|
||||
[ Thorsten Alteholz ]
|
||||
* fix spelling errors detected by lintian
|
||||
|
||||
[ Pau Espin Pedrol ]
|
||||
* tests: Fix db_test err file to expect error code name instead of value
|
||||
|
||||
[ Oliver Smith ]
|
||||
* tests/test_nodes.vty: check less libosmocore cmds
|
||||
* tests/db_upgrade: disable for old sqlite versions
|
||||
* gitignore: add tests/db_upgrade/*.dump
|
||||
* gsup_client.h: fix license header: GPLv2+
|
||||
* tests/auc: change back to python3
|
||||
|
||||
[ Neels Hofmeyr ]
|
||||
* fix double free in osmo_gsup_client_enc_send()
|
||||
* db upgrade to v2: log version 2, not 1
|
||||
* fix upgrade to version 2: imei column default value
|
||||
* add --db-check option
|
||||
* hlr.sql: move comment
|
||||
* add db_upgrade test
|
||||
* hlr db schema 3: hlr_number -> msc_number
|
||||
* db.c: code dup: add db_run_statements() for arrays of statements
|
||||
* move headers to include/osmocom/hlr
|
||||
* fix upgrade test in presence of ~/.sqliterc
|
||||
* db upgrade: remove some code dup
|
||||
* add osmo_gsup_msgb_alloc()
|
||||
* Makefile convenience: add VTY_TEST var to run only one test
|
||||
* remove gsup_test
|
||||
* test_nodes.vty: tweak: add some '?' checks
|
||||
* db v4: add column last_lu_seen_ps
|
||||
|
||||
[ Harald Welte ]
|
||||
* AUC: Add support for setting the AMF separation bit to '1' for EUTRAN
|
||||
* hlr: exit(2) on unsupported positional arguments on command line
|
||||
|
||||
-- Pau Espin Pedrol <pespin@sysmocom.de> Fri, 03 Jan 2020 12:37:35 +0100
|
||||
|
||||
osmo-hlr (1.1.0) unstable; urgency=medium
|
||||
|
||||
[ Oliver Smith ]
|
||||
|
||||
@@ -264,11 +264,11 @@ int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id,
|
||||
switch (aud->algo) {
|
||||
case OSMO_AUTH_ALG_NONE:
|
||||
case OSMO_AUTH_ALG_MILENAGE:
|
||||
case OSMO_AUTH_ALG_XOR:
|
||||
break;
|
||||
case OSMO_AUTH_ALG_COMP128v1:
|
||||
case OSMO_AUTH_ALG_COMP128v2:
|
||||
case OSMO_AUTH_ALG_COMP128v3:
|
||||
case OSMO_AUTH_ALG_XOR:
|
||||
LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:"
|
||||
" auth algo not suited for 3G: %s\n",
|
||||
osmo_auth_alg_name(aud->algo));
|
||||
|
||||
@@ -538,6 +538,55 @@ DEFUN(subscriber_aud3g,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN(subscriber_aud3g_xor,
|
||||
subscriber_aud3g_xor_cmd,
|
||||
SUBSCR_UPDATE "aud3g xor k K"
|
||||
" [ind-bitlen] [<0-28>]",
|
||||
SUBSCR_UPDATE_HELP
|
||||
"Set UMTS authentication data (3G, and 2G with UMTS AKA)\n"
|
||||
"Use XOR 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")
|
||||
{
|
||||
struct hlr_subscriber subscr;
|
||||
int minlen = 0;
|
||||
int maxlen = 0;
|
||||
int rc;
|
||||
const char *id_type = argv[0];
|
||||
const char *id = argv[1];
|
||||
const char *k = argv[2];
|
||||
int ind_bitlen = argc > 4? atoi(argv[4]) : 5;
|
||||
struct sub_auth_data_str aud3g = {
|
||||
.type = OSMO_AUTH_TYPE_UMTS,
|
||||
.u.umts = {
|
||||
.k = k,
|
||||
.opc_is_op = 0,
|
||||
.opc = "00000000000000000000000000000000",
|
||||
.ind_bitlen = ind_bitlen,
|
||||
},
|
||||
};
|
||||
|
||||
if (!auth_algo_parse("xor", &aud3g.algo, &minlen, &maxlen)) {
|
||||
vty_out(vty, "%% Unknown auth algorithm: '%s'%s", "xor", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
if (!is_hexkey_valid(vty, "K", aud3g.u.umts.k, minlen, maxlen))
|
||||
return CMD_WARNING;
|
||||
|
||||
if (get_subscr_by_argv(vty, id_type, id, &subscr))
|
||||
return CMD_WARNING;
|
||||
|
||||
rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud3g);
|
||||
|
||||
if (rc) {
|
||||
vty_out(vty, "%% Error: cannot set 3G auth data for IMSI='%s'%s",
|
||||
subscr.imsi, VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN(subscriber_imei,
|
||||
subscriber_imei_cmd,
|
||||
SUBSCR_UPDATE "imei (none|IMEI)",
|
||||
@@ -624,6 +673,7 @@ void hlr_vty_subscriber_init(void)
|
||||
install_element(ENABLE_NODE, &subscriber_aud2g_cmd);
|
||||
install_element(ENABLE_NODE, &subscriber_no_aud3g_cmd);
|
||||
install_element(ENABLE_NODE, &subscriber_aud3g_cmd);
|
||||
install_element(ENABLE_NODE, &subscriber_aud3g_xor_cmd);
|
||||
install_element(ENABLE_NODE, &subscriber_imei_cmd);
|
||||
install_element(ENABLE_NODE, &subscriber_nam_cmd);
|
||||
}
|
||||
|
||||
@@ -454,6 +454,50 @@ static void test_gen_vectors_3g_only(void)
|
||||
comment_end();
|
||||
}
|
||||
|
||||
static void test_gen_vectors_3g_xor(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_XOR,
|
||||
.u.umts.sqn = 0,
|
||||
};
|
||||
|
||||
osmo_hexparse("000102030405060708090a0b0c0d0e0f",
|
||||
aud3g.u.umts.k, sizeof(aud3g.u.umts.k));
|
||||
osmo_hexparse("00000000000000000000000000000000",
|
||||
aud3g.u.umts.opc, sizeof(aud3g.u.umts.opc));
|
||||
next_rand("b5039c57e4a75051551d1a390a71ce48", true);
|
||||
|
||||
vec = (struct osmo_auth_vector){ {0} };
|
||||
VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64);
|
||||
rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL);
|
||||
VERBOSE_ASSERT(rc, == 1, "%d");
|
||||
VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64);
|
||||
|
||||
VEC_IS(&vec,
|
||||
" rand: b5039c57e4a75051551d1a390a71ce48\n"
|
||||
" autn: 54e0a256565d0000b5029e54e0a25656\n"
|
||||
" ck: 029e54e0a256565d141032067cc047b5\n"
|
||||
" ik: 9e54e0a256565d141032067cc047b502\n"
|
||||
" res: b5029e54e0a256565d141032067cc047\n"
|
||||
" res_len: 10\n"
|
||||
" kc: 98e880384887f9fe\n"
|
||||
" sres: 0ec81877\n"
|
||||
" auth_types: 03000000\n"
|
||||
);
|
||||
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_gen_vectors_bad_args()
|
||||
{
|
||||
struct osmo_auth_vector vec;
|
||||
@@ -622,6 +666,7 @@ int main(int argc, char **argv)
|
||||
test_gen_vectors_2g_only();
|
||||
test_gen_vectors_2g_plus_3g();
|
||||
test_gen_vectors_3g_only();
|
||||
test_gen_vectors_3g_xor();
|
||||
test_gen_vectors_bad_args();
|
||||
|
||||
printf("Done\n");
|
||||
|
||||
@@ -217,6 +217,29 @@ DAUC vector [2]: auth_types = 0x3
|
||||
===== test_gen_vectors_3g_only: SUCCESS
|
||||
|
||||
|
||||
===== test_gen_vectors_3g_xor
|
||||
aud3g.u.umts.sqn == 0
|
||||
DAUC Computing 1 auth vector: 3G only (2G derived from 3G keys)
|
||||
DAUC 3G: k = 000102030405060708090a0b0c0d0e0f
|
||||
DAUC 3G: opc = 00000000000000000000000000000000
|
||||
DAUC 3G: for sqn ind 0, previous sqn was 0
|
||||
DAUC vector [0]: rand = b5039c57e4a75051551d1a390a71ce48
|
||||
DAUC vector [0]: sqn = 0
|
||||
DAUC vector [0]: autn = 54e0a256565d0000b5029e54e0a25656
|
||||
DAUC vector [0]: ck = 029e54e0a256565d141032067cc047b5
|
||||
DAUC vector [0]: ik = 9e54e0a256565d141032067cc047b502
|
||||
DAUC vector [0]: res = b5029e54e0a256565d141032067cc047
|
||||
DAUC vector [0]: res_len = 16
|
||||
DAUC vector [0]: deriving 2G from 3G
|
||||
DAUC vector [0]: kc = 98e880384887f9fe
|
||||
DAUC vector [0]: sres = 0ec81877
|
||||
DAUC vector [0]: auth_types = 0x3
|
||||
rc == 1
|
||||
aud3g.u.umts.sqn == 0
|
||||
vector matches expectations
|
||||
===== test_gen_vectors_3g_xor: SUCCESS
|
||||
|
||||
|
||||
===== test_gen_vectors_bad_args
|
||||
|
||||
- no auth data (a)
|
||||
|
||||
@@ -11,81 +11,21 @@ OsmoHLR> ?
|
||||
logp Print a message on all log outputs; useful for placing markers in test logs
|
||||
subscriber Subscriber management commands
|
||||
OsmoHLR> list
|
||||
show version
|
||||
show online-help
|
||||
list
|
||||
exit
|
||||
help
|
||||
enable
|
||||
terminal length <0-512>
|
||||
terminal no length
|
||||
who
|
||||
show history
|
||||
logging enable
|
||||
...
|
||||
show logging vty
|
||||
show alarms
|
||||
show talloc-context (application|all) (full|brief|DEPTH)
|
||||
show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS
|
||||
show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP
|
||||
show stats
|
||||
show stats level (global|peer|subscriber)
|
||||
show asciidoc counters
|
||||
show rate-counters
|
||||
show gsup-connections
|
||||
subscriber (imsi|msisdn|id|imei) IDENT show
|
||||
show subscriber (imsi|msisdn|id|imei) IDENT
|
||||
|
||||
OsmoHLR> enable
|
||||
OsmoHLR# ?
|
||||
help Description of the interactive help system
|
||||
list Print command list
|
||||
write Write running configuration to memory, network, or terminal
|
||||
show Show running system information
|
||||
exit Exit current mode and down to previous mode
|
||||
disable Turn off privileged mode command
|
||||
configure Configuration from vty interface
|
||||
copy Copy configuration
|
||||
terminal Set terminal line parameters
|
||||
who Display who is on vty
|
||||
logging Configure logging
|
||||
no Negate a command or set its defaults
|
||||
logp Print a message on all log outputs; useful for placing markers in test logs
|
||||
...
|
||||
subscriber Subscriber management commands
|
||||
OsmoHLR# list
|
||||
help
|
||||
...
|
||||
exit
|
||||
disable
|
||||
configure terminal
|
||||
copy running-config startup-config
|
||||
show startup-config
|
||||
show version
|
||||
show online-help
|
||||
terminal length <0-512>
|
||||
terminal no length
|
||||
who
|
||||
show history
|
||||
terminal monitor
|
||||
terminal no monitor
|
||||
logging enable
|
||||
...
|
||||
|
||||
OsmoHLR# configure terminal
|
||||
OsmoHLR(config)# ?
|
||||
...
|
||||
banner Set banner string
|
||||
service Set up miscellaneous service
|
||||
line Configure a terminal line
|
||||
ctrl Configure the Control Interface
|
||||
log Configure logging sub-system
|
||||
stats Configure stats sub-system
|
||||
hlr Configure the HLR
|
||||
OsmoHLR(config)# list
|
||||
help
|
||||
...
|
||||
exit
|
||||
end
|
||||
...
|
||||
hlr
|
||||
|
||||
@@ -99,10 +39,7 @@ OsmoHLR(config-hlr)# ?
|
||||
store-imei Save the IMEI in the database when receiving Check IMEI requests. Note that an MSC does not necessarily send Check IMEI requests (for OsmoMSC, you may want to set 'check-imei-rqd 1').
|
||||
subscriber-create-on-demand Make a new record when a subscriber is first seen.
|
||||
OsmoHLR(config-hlr)# list
|
||||
help
|
||||
...
|
||||
exit
|
||||
end
|
||||
gsup
|
||||
database PATH
|
||||
euse NAME
|
||||
|
||||
@@ -11,6 +11,7 @@ OsmoHLR# list
|
||||
subscriber (imsi|msisdn|id|imei) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor) 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 imei (none|IMEI)
|
||||
subscriber (imsi|msisdn|id|imei) IDENT update network-access-mode (none|cs|ps|cs+ps)
|
||||
|
||||
@@ -266,6 +267,7 @@ OsmoHLR# subscriber id 101 show
|
||||
OsmoHLR# subscriber imsi 123456789023000 update aud3g ?
|
||||
none Delete 3G authentication data
|
||||
milenage Use Milenage algorithm
|
||||
xor Use XOR algorithm
|
||||
|
||||
OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage ?
|
||||
k Set Encryption Key K
|
||||
|
||||
Reference in New Issue
Block a user