aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-05-30 18:55:20 +0200
committerlaforge <laforge@osmocom.org>2023-08-29 13:42:41 +0000
commit7a763aa0128b7a171b1ca56eea664c66dad4bf4c (patch)
tree099bfecb54b6678a89b86b568c9113ccbf3342bc
parent626f5eb74008f0f4e94485c53ac52e27bd7183cd (diff)
Add VTY support for TUAK algorithm
-rw-r--r--TODO-RELEASE2
-rw-r--r--src/hlr_vty_subscr.c23
-rw-r--r--tests/test_subscriber.vty3
3 files changed, 19 insertions, 9 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 4c445eb..042d1a7 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -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
diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c
index 28cc5b3..59a27c1 100644
--- a/src/hlr_vty_subscr.c
+++ b/src/hlr_vty_subscr.c
@@ -468,9 +468,10 @@ static bool is_hexkey_valid(struct vty *vty, const char *label,
"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_opc, int *maxlen_opc)
@@ -507,6 +508,14 @@ bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo,
*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;
@@ -631,11 +640,11 @@ DEFUN(subscriber_aud3g,
int rc;
const char *id_type = argv[0];
const char *id = argv[1];
- const char *alg_type = AUTH_ALG_TYPES_3G;
- const char *k = argv[2];
- bool opc_is_op = (strcasecmp("op", argv[3]) == 0);
- const char *op_opc = argv[4];
- int ind_bitlen = argc > 6? atoi(argv[6]) : 5;
+ const char *alg_type = argv[2];
+ const char *k = argv[3];
+ bool opc_is_op = (strcasecmp("op", argv[4]) == 0);
+ const char *op_opc = argv[5];
+ int ind_bitlen = argc > 7 ? atoi(argv[7]) : 5;
struct sub_auth_data_str aud3g = {
.type = OSMO_AUTH_TYPE_UMTS,
.u.umts = {
diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty
index 9036fb8..5f223dc 100644
--- a/tests/test_subscriber.vty
+++ b/tests/test_subscriber.vty
@@ -10,7 +10,7 @@ OsmoHLR# list
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,6 +269,7 @@ OsmoHLR# subscriber id 101 show
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 ?