diff options
author | Harald Welte <laforge@osmocom.org> | 2023-02-21 22:24:15 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2023-02-22 09:45:15 +0100 |
commit | 9b7c9ae6ca576b4b821871c9576de9ee4ab9c14c (patch) | |
tree | 37d5212c5c29c9cb4eae03ff3b44b0fcf274cf34 | |
parent | 4cc60a166cccc24e4611e6d9c5a2e4f063fe5fa0 (diff) |
Rename OSMO_AUTH_ALG_XOR to OSMO_AUTH_ALG_XOR_3G
Let's disambiguate. Our existing OSMO_AUTH_ALG_XOR was always only
the XOR-3G algorithm. Now that we recently introduced XOR-2G,
let's rename (with backwards compatibility #define).
Change-Id: I446e54d0ddf4a18c46ee022b1249af73552e3ce1
-rw-r--r-- | include/osmocom/crypt/auth.h | 5 | ||||
-rw-r--r-- | src/gsm/auth_core.c | 2 | ||||
-rw-r--r-- | src/gsm/auth_xor.c | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 4af8ca8e..d872f642 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -30,11 +30,14 @@ enum osmo_auth_algo { OSMO_AUTH_ALG_COMP128v1, OSMO_AUTH_ALG_COMP128v2, OSMO_AUTH_ALG_COMP128v3, - OSMO_AUTH_ALG_XOR, + OSMO_AUTH_ALG_XOR_3G, OSMO_AUTH_ALG_MILENAGE, OSMO_AUTH_ALG_XOR_2G, _OSMO_AUTH_ALG_NUM, }; +/* Backwards-compatibility. We used to call XOR-3G just "XOR" which became ambiguous when + * we started to add XOR-2G support. */ +#define OSMO_AUTH_ALG_XOR OSMO_AUTH_ALG_XOR_3G /*! permanent (secret) subscriber auth data */ struct osmo_sub_auth_data { diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index af03ace1..ce6ba7df 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -208,7 +208,7 @@ static const struct value_string auth_alg_vals[] = { { OSMO_AUTH_ALG_COMP128v1, "COMP128v1" }, { OSMO_AUTH_ALG_COMP128v2, "COMP128v2" }, { OSMO_AUTH_ALG_COMP128v3, "COMP128v3" }, - { OSMO_AUTH_ALG_XOR, "XOR" }, + { OSMO_AUTH_ALG_XOR_3G, "XOR-3G" }, { OSMO_AUTH_ALG_MILENAGE, "MILENAGE" }, { OSMO_AUTH_ALG_XOR_2G, "XOR-2G" }, { 0, NULL } diff --git a/src/gsm/auth_xor.c b/src/gsm/auth_xor.c index 45075421..81076bda 100644 --- a/src/gsm/auth_xor.c +++ b/src/gsm/auth_xor.c @@ -168,8 +168,8 @@ static int xor_gen_vec_auts(struct osmo_auth_vector *vec, } static struct osmo_auth_impl xor_alg = { - .algo = OSMO_AUTH_ALG_XOR, - .name = "XOR (libosmogsm built-in)", + .algo = OSMO_AUTH_ALG_XOR_3G, + .name = "XOR-3G (libosmogsm built-in)", .priority = 1000, .gen_vec = &xor_gen_vec, .gen_vec_auts = &xor_gen_vec_auts, |