laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/33099 )

 (

5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: Add VTY support for TUAK algorithm
......................................................................

Add VTY support for TUAK algorithm

Change-Id: If2611658f7cb990b484d7429ab2f944f56fd2eb6
Depends: libosmocore.git Ib905b8d8bdf248e8299bf50666ee1bca8298433d
---
M TODO-RELEASE
M src/hlr_vty_subscr.c
M tests/test_subscriber.vty
3 files changed, 29 insertions(+), 9 deletions(-)

Approvals:
  neels: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




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 @@
        "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 @@
                        *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 @@
        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 @@
   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 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 ?

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/33099
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: If2611658f7cb990b484d7429ab2f944f56fd2eb6
Gerrit-Change-Number: 33099
Gerrit-PatchSet: 7
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to