aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-22 19:29:41 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-05-01 01:32:13 +0200
commitaa4ed671643c1d7bcd0ae05faa9aef236d9ad5ff (patch)
tree25489e12e63bd33438688ff33c64b8c5b4cda460 /include
parent7554fd1b5e49c809dbb95967cfc6f146e15f505a (diff)
GERAN: allow GSM SRES on UMTS AKA challenge
Store the established security context type (GSM or UMTS) instead of the boolean flag is_authenticated. Provide the previous boolean query with thin sgsn_mm_ctx_is_authenticated() function. Knowing which security context was established will be necessary for OS#3224, i.e. using the proper ciphering key, which is not yet tested properly, and probably not correct at this stage. This change will make new SGSN_Tests.TC_attach_umts_aka_gsm_sres pass. Related: OS#3193 OS#3224 Change-Id: I36807bad3bc55c0030d4f09cb2c369714f24bec7
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/sgsn/gprs_sgsn.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index c47fb090..64e5619d 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -224,7 +224,7 @@ struct sgsn_mm_ctx {
* whether one of them can be dropped. */
enum sgsn_auth_state auth_state;
- int is_authenticated;
+ enum osmo_sub_auth_type sec_ctx;
/* the string representation of the current hlr */
char hlr[GSM_EXTENSION_LENGTH];
@@ -235,6 +235,17 @@ struct sgsn_mm_ctx {
struct gprs_subscr *subscr;
};
+static inline bool sgsn_mm_ctx_is_authenticated(struct sgsn_mm_ctx *ctx)
+{
+ switch (ctx->sec_ctx) {
+ case OSMO_AUTH_TYPE_GSM:
+ case OSMO_AUTH_TYPE_UMTS:
+ return true;
+ default:
+ return false;
+ }
+}
+
#define LOGMMCTXP(level, mm, fmt, args...) \
LOGP(DMM, level, "MM(%s/%08x) " fmt, (mm) ? (mm)->imsi : "---", \
(mm) ? (mm)->p_tmsi : GSM_RESERVED_TMSI, ## args)