Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 1 | /* Osmocom MSC+VLR end-to-end tests */ |
| 2 | |
| 3 | /* (C) 2017 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> |
| 4 | * |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * Author: Neels Hofmeyr <nhofmeyr@sysmocom.de> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU Affero General Public License as published by |
| 11 | * the Free Software Foundation; either version 3 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU Affero General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU Affero General Public License |
| 20 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | /* NOTE that further auth re-use tests exist in msc_vlr_test_hlr_reject.c */ |
| 25 | |
| 26 | #include "msc_vlr_tests.h" |
| 27 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 28 | static void _test_auth_reuse(enum osmo_rat_type via_ran, |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 29 | int set_max_reuse_count, |
| 30 | int loop_requests_without_hlr, |
| 31 | bool final_request_with_hlr) |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 32 | { |
| 33 | struct vlr_subscr *vsub; |
| 34 | const char *imsi = "901700000010650"; |
| 35 | int expected_use_count; |
| 36 | int i; |
| 37 | |
| 38 | net->authentication_required = true; |
| 39 | net->vlr->cfg.assign_tmsi = true; |
| 40 | net->vlr->cfg.auth_tuple_max_reuse_count = set_max_reuse_count; |
| 41 | net->vlr->cfg.auth_reuse_old_sets_on_error = false; |
| 42 | rx_from_ran = via_ran; |
| 43 | |
| 44 | btw("Location Update request causes a GSUP Send Auth Info request to HLR"); |
| 45 | lu_result_sent = RES_NONE; |
Neels Hofmeyr | 63b2464 | 2019-12-12 01:31:04 +0100 | [diff] [blame] | 46 | gsup_expect_tx("080108" "09710000000156f0" CN_DOMAIN VLR_TO_HLR); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 47 | ms_sends_msg("0508" /* MM LU */ |
| 48 | "7" /* ciph key seq: no key available */ |
| 49 | "0" /* LU type: normal */ |
| 50 | "ffffff" "0000" /* LAI, LAC */ |
| 51 | "57" /* classmark 1: R99, early classmark, no power lvl */ |
| 52 | "089910070000106005" /* IMSI */ |
| 53 | "3303575886" /* classmark 2 */ |
| 54 | ); |
| 55 | OSMO_ASSERT(gsup_tx_confirmed); |
| 56 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 57 | |
| 58 | btw("from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS"); |
| 59 | /* based on auc_3g: |
| 60 | * K = 'EB215756028D60E3275E613320AEC880', |
| 61 | * OPC = 'FB2A3D1B360F599ABAB99DB8669F8308' |
| 62 | * SQN = 0 |
| 63 | */ |
| 64 | auth_request_sent = false; |
| 65 | auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d"; |
| 66 | auth_request_expect_autn = "8704f5ba55f30000d2ee44b22c8ea919"; |
| 67 | gsup_rx("0a" |
| 68 | /* imsi */ |
| 69 | "0108" "09710000000156f0" |
| 70 | /* TL TL rand */ |
| 71 | "0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d" |
| 72 | /* TL sres TL kc */ |
| 73 | "2104" "9b36efdf" "2208" "059a4f668f6fbe39" |
| 74 | /* TL 3G IK */ |
| 75 | "2310" "27497388b6cb044648f396aa155b95ef" |
| 76 | /* TL 3G CK */ |
| 77 | "2410" "f64735036e5871319c679f4742a75ea1" |
| 78 | /* TL AUTN */ |
| 79 | "2510" "8704f5ba55f30000d2ee44b22c8ea919" |
| 80 | /* TL RES */ |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 81 | "2708" "e229c19e791f2e41" HLR_TO_VLR, |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 82 | NULL); |
| 83 | VERBOSE_ASSERT(auth_request_sent, == true, "%d"); |
| 84 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 85 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 86 | if (via_ran == OSMO_RAT_GERAN_A) { |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 87 | btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR"); |
Neels Hofmeyr | 63b2464 | 2019-12-12 01:31:04 +0100 | [diff] [blame] | 88 | gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 89 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
| 90 | VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); |
| 91 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 92 | } else { |
| 93 | /* On UTRAN */ |
| 94 | btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 95 | expect_security_mode_ctrl(NULL, "27497388b6cb044648f396aa155b95ef"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 96 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 97 | VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 98 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 99 | |
| 100 | btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR"); |
Neels Hofmeyr | 63b2464 | 2019-12-12 01:31:04 +0100 | [diff] [blame] | 101 | gsup_expect_tx("04010809710000000156f0" CN_DOMAIN VLR_TO_HLR); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 102 | ms_sends_security_mode_complete(); |
| 103 | VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); |
| 104 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 105 | } |
| 106 | |
| 107 | btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 108 | gsup_rx("10010809710000000156f00804032443f2" HLR_TO_VLR, |
| 109 | "12010809710000000156f0" VLR_TO_HLR); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 110 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 111 | |
| 112 | btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 113 | gsup_rx("06010809710000000156f0" HLR_TO_VLR, NULL); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 114 | |
| 115 | VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); |
| 116 | |
| 117 | btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); |
| 118 | EXPECT_CONN_COUNT(1); |
| 119 | EXPECT_ACCEPTED(false); |
| 120 | thwart_rx_non_initial_requests(); |
| 121 | |
| 122 | btw("even though the TMSI is not acked, we can already find the subscr with it"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 123 | vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 124 | VERBOSE_ASSERT(vsub != NULL, == true, "%d"); |
| 125 | VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); |
| 126 | VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x"); |
| 127 | VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 128 | vlr_subscr_put(vsub, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 129 | |
| 130 | btw("MS sends TMSI Realloc Complete"); |
| 131 | expect_release_clear(via_ran); |
| 132 | ms_sends_msg("055b"); |
| 133 | ASSERT_RELEASE_CLEAR(via_ran); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 134 | ran_sends_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 135 | |
| 136 | btw("LU was successful, and the conn has already been closed"); |
| 137 | EXPECT_CONN_COUNT(0); |
| 138 | |
| 139 | expected_use_count = 1; |
| 140 | |
| 141 | for (i = 0; i < loop_requests_without_hlr; i++, expected_use_count++) { |
| 142 | BTW("Now the auth tuple has use_count == %d", expected_use_count); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 143 | vsub = vlr_subscr_find_by_imsi(net->vlr, imsi, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 144 | OSMO_ASSERT(vsub); |
| 145 | OSMO_ASSERT(vsub->last_tuple); |
| 146 | VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 147 | vlr_subscr_put(vsub, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 148 | |
| 149 | BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," |
| 150 | " and reuses old auth vector"); |
| 151 | auth_request_sent = true; |
| 152 | cm_service_result_sent = RES_NONE; |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 153 | ms_sends_msg("052474" |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 154 | "03575886" /* classmark 2 */ |
| 155 | "089910070000106005" /* IMSI */); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 156 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 157 | VERBOSE_ASSERT(auth_request_sent, == true, "%d"); |
| 158 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 159 | if (via_ran == OSMO_RAT_GERAN_A) { |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 160 | btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); |
| 161 | gsup_expect_tx(NULL); |
| 162 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
| 163 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 164 | } else { |
| 165 | /* On UTRAN */ |
| 166 | btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 167 | expect_security_mode_ctrl(NULL, "27497388b6cb044648f396aa155b95ef"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 168 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 169 | VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 170 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 171 | |
| 172 | btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); |
| 173 | ms_sends_security_mode_complete(); |
| 174 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 175 | } |
| 176 | |
Vadim Yanitskiy | 2760585 | 2018-06-15 23:57:30 +0700 | [diff] [blame] | 177 | /* Release connection */ |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 178 | expect_release_clear(via_ran); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 179 | conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS); |
| 180 | ran_sends_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 181 | |
| 182 | btw("all requests serviced, conn has been released"); |
| 183 | EXPECT_CONN_COUNT(0); |
| 184 | } |
| 185 | |
| 186 | if (final_request_with_hlr) { |
| 187 | BTW("Now the auth tuple has use_count == %d, as much as is allowed.", expected_use_count); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 188 | vsub = vlr_subscr_find_by_imsi(net->vlr, imsi, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 189 | OSMO_ASSERT(vsub); |
| 190 | OSMO_ASSERT(vsub->last_tuple); |
| 191 | VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 192 | vlr_subscr_put(vsub, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 193 | |
| 194 | BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," |
| 195 | " and needs to request a second auth vector from HLR"); |
| 196 | auth_request_sent = false; |
| 197 | cm_service_result_sent = RES_NONE; |
Neels Hofmeyr | 63b2464 | 2019-12-12 01:31:04 +0100 | [diff] [blame] | 198 | gsup_expect_tx("080108" "09710000000156f0" CN_DOMAIN VLR_TO_HLR); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 199 | ms_sends_msg("052474" |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 200 | "03575886" /* classmark 2 */ |
| 201 | "089910070000106005" /* IMSI */); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 202 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 203 | VERBOSE_ASSERT(auth_request_sent, == false, "%d"); |
| 204 | VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); |
| 205 | |
| 206 | btw("from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS"); |
| 207 | auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d"; |
| 208 | auth_request_expect_autn = "1843a645b98d00005b2d666af46c45d9"; |
| 209 | gsup_rx("0a" |
| 210 | /* imsi */ |
| 211 | "0108" "09710000000156f0" |
| 212 | /* TL TL rand */ |
| 213 | /* TL sres TL kc */ |
| 214 | /* TL 3G IK */ |
| 215 | /* TL 3G CK */ |
| 216 | /* TL AUTN */ |
| 217 | /* TL RES */ |
| 218 | "0362" "2010" "c187a53a5e6b9d573cac7c74451fd46d" |
| 219 | "2104" "85aa3130" "2208" "d3d50a000bf04f6e" |
| 220 | "2310" "1159ec926a50e98c034a6b7d7c9f418d" |
| 221 | "2410" "df3a03d9ca5335641efc8e36d76cd20b" |
| 222 | "2510" "1843a645b98d00005b2d666af46c45d9" |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 223 | "2708" "7db47cf7f81e4dc7" HLR_TO_VLR, |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 224 | NULL); |
| 225 | VERBOSE_ASSERT(auth_request_sent, == true, "%d"); |
| 226 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 227 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 228 | if (via_ran == OSMO_RAT_GERAN_A) { |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 229 | btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); |
| 230 | gsup_expect_tx(NULL); |
| 231 | ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ |
| 232 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 233 | } else { |
| 234 | /* On UTRAN */ |
| 235 | btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 236 | expect_security_mode_ctrl(NULL, "1159ec926a50e98c034a6b7d7c9f418d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 237 | ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 238 | VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 239 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 240 | |
| 241 | btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); |
| 242 | ms_sends_security_mode_complete(); |
| 243 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 244 | } |
| 245 | |
Vadim Yanitskiy | 2760585 | 2018-06-15 23:57:30 +0700 | [diff] [blame] | 246 | /* Release connection */ |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 247 | expect_release_clear(via_ran); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 248 | conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS); |
| 249 | ran_sends_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 250 | |
| 251 | btw("all requests serviced, conn has been released"); |
| 252 | EXPECT_CONN_COUNT(0); |
| 253 | } |
| 254 | |
| 255 | BTW("subscriber detaches"); |
| 256 | expect_release_clear(via_ran); |
| 257 | ms_sends_msg("050130" |
| 258 | "089910070000106005" /* IMSI */); |
| 259 | ASSERT_RELEASE_CLEAR(via_ran); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 260 | ran_sends_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 261 | |
| 262 | EXPECT_CONN_COUNT(0); |
| 263 | clear_vlr(); |
| 264 | } |
| 265 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 266 | static void test_auth_use_twice_geran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 267 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 268 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 269 | _test_auth_reuse(OSMO_RAT_GERAN_A, 1, 1, true); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 270 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 271 | } |
| 272 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 273 | static void test_auth_use_twice_utran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 274 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 275 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 276 | _test_auth_reuse(OSMO_RAT_UTRAN_IU, 1, 1, true); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 277 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 278 | } |
| 279 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 280 | static void test_auth_use_infinitely_geran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 281 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 282 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 283 | _test_auth_reuse(OSMO_RAT_GERAN_A, -1, 3, false); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 284 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 285 | } |
| 286 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 287 | static void test_auth_use_infinitely_utran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 288 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 289 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 290 | _test_auth_reuse(OSMO_RAT_UTRAN_IU, -1, 3, false); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 291 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 292 | } |
| 293 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 294 | static void test_no_auth_reuse_geran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 295 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 296 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 297 | _test_auth_reuse(OSMO_RAT_GERAN_A, 0, 0, true); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 298 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 299 | } |
| 300 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 301 | static void test_no_auth_reuse_utran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 302 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 303 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 304 | _test_auth_reuse(OSMO_RAT_UTRAN_IU, 0, 0, true); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 305 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | msc_vlr_test_func_t msc_vlr_tests[] = { |
| 309 | test_auth_use_twice_geran, |
| 310 | test_auth_use_twice_utran, |
| 311 | test_auth_use_infinitely_geran, |
| 312 | test_auth_use_infinitely_utran, |
| 313 | test_no_auth_reuse_geran, |
| 314 | test_no_auth_reuse_utran, |
| 315 | NULL |
| 316 | }; |