summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/crypt/auth.h1
-rw-r--r--src/gsm/auth_milenage.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h
index 7064c999..1b017c0a 100644
--- a/include/osmocom/crypt/auth.h
+++ b/include/osmocom/crypt/auth.h
@@ -10,6 +10,7 @@
#include <osmocom/core/utils.h>
#define OSMO_A5_MAX_KEY_LEN_BYTES (128/8)
+#define OSMO_MILENAGE_IND_BITLEN_MAX 28
/*! Authentication Type (GSM/UMTS) */
enum osmo_sub_auth_type {
diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c
index e1a1dfba..2ddf712b 100644
--- a/src/gsm/auth_milenage.c
+++ b/src/gsm/auth_milenage.c
@@ -112,7 +112,7 @@ static int milenage_gen_vec(struct osmo_auth_vector *vec,
* { .ind_bitlen = 0, .ind = 0, .sqn = (desired_sqn - 1) }
*/
- if (aud->u.umts.ind_bitlen > 28)
+ if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX)
return -2;
seq_1 = 1LL << aud->u.umts.ind_bitlen;