aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-10-19 17:09:11 +0200
committerAlexander Couzens <lynxis@fe80.eu>2021-11-05 01:29:05 +0100
commit2aaff7513ba76b6ddacdeced36e37d249c84c5d5 (patch)
tree3eab371620bb07f58551a6757a9bdfb450c95b5d /tests
parent505a94a610fc7dfa4baa4fb3d9197d7564cde0d3 (diff)
Validate the choosen UTRAN encryption algorithm
RANAP Security Command can include an encryption IE. If it includes it the RNC can still ignore it (e.g. unsupported encryption) and return the Security Command Complete with an choosen encryption IE: "no encryption". Validate the encryption element and ensure the encryption is included in the encryption mask. Closes: OS#4144 Change-Id: Icfc135c8b8ae862defe7114db492af600c26407f
Diffstat (limited to 'tests')
-rw-r--r--tests/msc_vlr/msc_vlr_test_authen_reuse.c6
-rw-r--r--tests/msc_vlr/msc_vlr_test_call.c12
-rw-r--r--tests/msc_vlr/msc_vlr_test_umts_authen.c8
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c3
-rw-r--r--tests/msc_vlr/msc_vlr_tests.h2
5 files changed, 16 insertions, 15 deletions
diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.c b/tests/msc_vlr/msc_vlr_test_authen_reuse.c
index f8f938378..870f99369 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.c
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.c
@@ -99,7 +99,7 @@ static void _test_auth_reuse(enum osmo_rat_type via_ran,
btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR");
gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d");
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
}
@@ -170,7 +170,7 @@ static void _test_auth_reuse(enum osmo_rat_type via_ran,
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept");
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
}
@@ -239,7 +239,7 @@ static void _test_auth_reuse(enum osmo_rat_type via_ran,
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept");
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
}
diff --git a/tests/msc_vlr/msc_vlr_test_call.c b/tests/msc_vlr/msc_vlr_test_call.c
index 9ab1066a6..a547935b2 100644
--- a/tests/msc_vlr/msc_vlr_test_call.c
+++ b/tests/msc_vlr/msc_vlr_test_call.c
@@ -128,7 +128,7 @@ static void lu_utran_tmsi()
btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR");
gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d");
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
@@ -197,7 +197,7 @@ static void test_call_mo()
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept");
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
BTW("a call is initiated");
@@ -317,7 +317,7 @@ static void test_call_mt()
btw("MS sends SecurityModeControl acceptance, VLR accepts, sends CC Setup");
dtap_expect_tx("0305" /* CC: Setup */);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
btw("MS confirms call, we create a RAN-side RTP and forward MNCC_CALL_CONF_IND");
expect_crcx(RTP_TO_RAN);
@@ -420,7 +420,7 @@ static void test_call_mt2()
btw("MS sends SecurityModeControl acceptance, VLR accepts, sends CC Setup");
dtap_expect_tx("0305" /* CC: Setup */);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
btw("MS confirms call, we create a RAN-side RTP and forward MNCC_CALL_CONF_IND");
expect_crcx(RTP_TO_RAN);
@@ -509,7 +509,7 @@ static void test_call_mo_to_unknown()
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept");
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
BTW("a call is initiated");
@@ -605,7 +605,7 @@ static void test_call_mo_to_unknown_timeout()
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept");
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
BTW("a call is initiated");
diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.c b/tests/msc_vlr/msc_vlr_test_umts_authen.c
index e462ef4df..655183b35 100644
--- a/tests/msc_vlr/msc_vlr_test_umts_authen.c
+++ b/tests/msc_vlr/msc_vlr_test_umts_authen.c
@@ -138,7 +138,7 @@ static void _test_umts_authen(enum osmo_rat_type via_ran)
btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR");
gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d");
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
}
@@ -211,7 +211,7 @@ static void _test_umts_authen(enum osmo_rat_type via_ran)
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept");
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
}
} else {
@@ -278,7 +278,7 @@ static void _test_umts_authen(enum osmo_rat_type via_ran)
btw("MS sends SecurityModeControl acceptance, VLR accepts and sends SMS");
dtap_expect_tx(sms);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
}
} else {
/* Encryption disabled */
@@ -530,7 +530,7 @@ static void _test_umts_authen_resync(enum osmo_rat_type via_ran)
btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR");
gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR);
- ms_sends_security_mode_complete();
+ ms_sends_security_mode_complete(1);
VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d");
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
}
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 102fba72e..fbd254018 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -986,12 +986,13 @@ void ms_sends_ciphering_mode_complete(const char *inner_ran_msg)
g_msub = NULL;
}
-void ms_sends_security_mode_complete()
+void ms_sends_security_mode_complete(uint8_t utran_encryption)
{
struct ran_msg ran_dec;
ran_dec = (struct ran_msg){
.msg_type = RAN_MSG_CIPHER_MODE_COMPLETE,
+ .cipher_mode_complete.utran_encryption = utran_encryption,
};
fake_msc_a_ran_dec(&ran_dec);
diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index 23dc9daa8..a2b2f22f5 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -184,7 +184,7 @@ void paging_expect_tmsi(uint32_t tmsi);
void ms_sends_msg(const char *hex);
void ms_sends_classmark_update(const struct osmo_gsm48_classmark *classmark);
void ms_sends_ciphering_mode_complete(const char *inner_nas_msg);
-void ms_sends_security_mode_complete();
+void ms_sends_security_mode_complete(uint8_t utran_encryption);
void ms_sends_assignment_complete(enum mgcp_codecs assigned_codec);
void gsup_rx(const char *rx_hex, const char *expect_tx_hex);
void send_sms(struct vlr_subscr *receiver,