diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-18 12:35:41 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-18 12:43:17 +0200 |
commit | 9fb17c6c8c3a498efa8757b9ef1c72d9097d6384 (patch) | |
tree | 6e13f11e6614138fb03acbd28f13bd36cbd2e487 | |
parent | 435f67f43c4323702b6c59d74017860e6337dd53 (diff) |
add alg_id arg to ms_sends_cipher_mode_complete()
-rw-r--r-- | tests/msc_vlr/msc_vlr_test_gsm_ciph.c | 36 | ||||
-rw-r--r-- | tests/msc_vlr/msc_vlr_tests.c | 5 | ||||
-rw-r--r-- | tests/msc_vlr/msc_vlr_tests.h | 2 |
3 files changed, 23 insertions, 20 deletions
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index 38a5caff0..4643581f7 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -83,7 +83,7 @@ static void test_ciph() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -124,7 +124,7 @@ static void test_ciph() thwart_rx_non_initial_requests(); btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); /* Release connection */ @@ -198,7 +198,7 @@ static void test_ciph() "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e" "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb" "0c7ac3e9e9b7db05"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); btw("SMS was delivered, no requests pending for subscr"); @@ -293,7 +293,7 @@ static void test_ciph_tmsi() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -359,7 +359,7 @@ static void test_ciph_tmsi() thwart_rx_non_initial_requests(); btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); /* Release connection */ @@ -433,7 +433,7 @@ static void test_ciph_tmsi() "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e" "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb" "0c7ac3e9e9b7db05"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); btw("SMS was delivered, no requests pending for subscr"); @@ -527,7 +527,7 @@ static void test_ciph_imei() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -643,7 +643,7 @@ static void test_ciph_imeisv() btw("MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete("063217094332244332244372f5"); + ms_sends_ciphering_mode_complete("063217094332244332244372f5", 1); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("Subscriber has the IMEISV"); @@ -738,7 +738,7 @@ static void test_ciph_tmsi_imei() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -923,7 +923,7 @@ static void test_gsm_ciph_in_umts_env() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -963,7 +963,7 @@ static void test_gsm_ciph_in_umts_env() VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); /* Release connection */ @@ -1016,7 +1016,7 @@ static void test_gsm_ciph_in_umts_env() btw("MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS"); dtap_expect_tx(sms); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 1); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); btw("SMS was delivered, no requests pending for subscr"); @@ -1112,7 +1112,7 @@ static void test_a5_3_supported() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 3); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -1154,7 +1154,7 @@ static void test_a5_3_supported() thwart_rx_non_initial_requests(); btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 3); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); /* Release connection */ @@ -1228,7 +1228,7 @@ static void test_a5_3_supported() "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e" "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb" "0c7ac3e9e9b7db05"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 3); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); btw("SMS was delivered, no requests pending for subscr"); @@ -1328,7 +1328,7 @@ static void test_cm_service_needs_classmark_update() btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 3); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); @@ -1371,7 +1371,7 @@ static void test_cm_service_needs_classmark_update() thwart_rx_non_initial_requests(); btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 3); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); /* Release connection */ @@ -1453,7 +1453,7 @@ static void test_cm_service_needs_classmark_update() "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e" "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb" "0c7ac3e9e9b7db05"); - ms_sends_ciphering_mode_complete(NULL); + ms_sends_ciphering_mode_complete(NULL, 3); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); btw("SMS was delivered, no requests pending for subscr"); diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 56f368431..7f81fbcd7 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -957,7 +957,7 @@ static int fake_vlr_tx_auth_rej(void *msc_conn_ref) return 0; } -void ms_sends_ciphering_mode_complete(const char *inner_ran_msg) +void ms_sends_ciphering_mode_complete(const char *inner_ran_msg, uint8_t chosen_encr_alg_nr) { struct ran_msg ran_dec; @@ -965,6 +965,9 @@ void ms_sends_ciphering_mode_complete(const char *inner_ran_msg) ran_dec = (struct ran_msg){ .msg_type = RAN_MSG_CIPHER_MODE_COMPLETE, + .cipher_mode_complete = { + .alg_id = chosen_encr_alg_nr + 1, + }, }; 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..fe80af592 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -183,7 +183,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_ciphering_mode_complete(const char *inner_ran_msg, uint8_t chosen_encr_alg); void ms_sends_security_mode_complete(); void ms_sends_assignment_complete(enum mgcp_codecs assigned_codec); void gsup_rx(const char *rx_hex, const char *expect_tx_hex); |