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" |
Harald Welte | 0df904d | 2018-12-03 11:00:04 +0100 | [diff] [blame] | 27 | #include "stubs.h" |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 28 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 29 | static void _test_auth_reuse(enum osmo_rat_type via_ran, |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 30 | int set_max_reuse_count, |
| 31 | int loop_requests_without_hlr, |
| 32 | bool final_request_with_hlr) |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 33 | { |
| 34 | struct vlr_subscr *vsub; |
| 35 | const char *imsi = "901700000010650"; |
| 36 | int expected_use_count; |
| 37 | int i; |
| 38 | |
| 39 | net->authentication_required = true; |
| 40 | net->vlr->cfg.assign_tmsi = true; |
| 41 | net->vlr->cfg.auth_tuple_max_reuse_count = set_max_reuse_count; |
| 42 | net->vlr->cfg.auth_reuse_old_sets_on_error = false; |
| 43 | rx_from_ran = via_ran; |
| 44 | |
| 45 | btw("Location Update request causes a GSUP Send Auth Info request to HLR"); |
| 46 | lu_result_sent = RES_NONE; |
| 47 | gsup_expect_tx("080108" "09710000000156f0"); |
| 48 | ms_sends_msg("0508" /* MM LU */ |
| 49 | "7" /* ciph key seq: no key available */ |
| 50 | "0" /* LU type: normal */ |
| 51 | "ffffff" "0000" /* LAI, LAC */ |
| 52 | "57" /* classmark 1: R99, early classmark, no power lvl */ |
| 53 | "089910070000106005" /* IMSI */ |
| 54 | "3303575886" /* classmark 2 */ |
| 55 | ); |
| 56 | OSMO_ASSERT(gsup_tx_confirmed); |
| 57 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 58 | |
| 59 | btw("from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS"); |
| 60 | /* based on auc_3g: |
| 61 | * K = 'EB215756028D60E3275E613320AEC880', |
| 62 | * OPC = 'FB2A3D1B360F599ABAB99DB8669F8308' |
| 63 | * SQN = 0 |
| 64 | */ |
| 65 | auth_request_sent = false; |
| 66 | auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d"; |
| 67 | auth_request_expect_autn = "8704f5ba55f30000d2ee44b22c8ea919"; |
| 68 | gsup_rx("0a" |
| 69 | /* imsi */ |
| 70 | "0108" "09710000000156f0" |
| 71 | /* TL TL rand */ |
| 72 | "0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d" |
| 73 | /* TL sres TL kc */ |
| 74 | "2104" "9b36efdf" "2208" "059a4f668f6fbe39" |
| 75 | /* TL 3G IK */ |
| 76 | "2310" "27497388b6cb044648f396aa155b95ef" |
| 77 | /* TL 3G CK */ |
| 78 | "2410" "f64735036e5871319c679f4742a75ea1" |
| 79 | /* TL AUTN */ |
| 80 | "2510" "8704f5ba55f30000d2ee44b22c8ea919" |
| 81 | /* TL RES */ |
| 82 | "2708" "e229c19e791f2e41", |
| 83 | NULL); |
| 84 | VERBOSE_ASSERT(auth_request_sent, == true, "%d"); |
| 85 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 86 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 87 | if (via_ran == OSMO_RAT_GERAN_A) { |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 88 | btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR"); |
Neels Hofmeyr | d0756b1 | 2018-09-28 02:41:39 +0200 | [diff] [blame] | 89 | gsup_expect_tx("04010809710000000156f0280102"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 90 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
| 91 | VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); |
| 92 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 93 | } else { |
| 94 | /* On UTRAN */ |
| 95 | btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 96 | expect_security_mode_ctrl(NULL, "27497388b6cb044648f396aa155b95ef"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 97 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 98 | VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 99 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 100 | |
| 101 | btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR"); |
Neels Hofmeyr | d0756b1 | 2018-09-28 02:41:39 +0200 | [diff] [blame] | 102 | gsup_expect_tx("04010809710000000156f0280102"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 103 | ms_sends_security_mode_complete(); |
| 104 | VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); |
| 105 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 106 | } |
| 107 | |
| 108 | btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); |
| 109 | gsup_rx("10010809710000000156f00804032443f2", |
| 110 | "12010809710000000156f0"); |
| 111 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 112 | |
| 113 | btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); |
| 114 | gsup_rx("06010809710000000156f0", NULL); |
| 115 | |
| 116 | VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); |
| 117 | |
| 118 | btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); |
| 119 | EXPECT_CONN_COUNT(1); |
| 120 | EXPECT_ACCEPTED(false); |
| 121 | thwart_rx_non_initial_requests(); |
| 122 | |
| 123 | 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] | 124 | vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 125 | VERBOSE_ASSERT(vsub != NULL, == true, "%d"); |
| 126 | VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); |
| 127 | VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x"); |
| 128 | VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 129 | vlr_subscr_put(vsub, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 130 | |
| 131 | btw("MS sends TMSI Realloc Complete"); |
| 132 | expect_release_clear(via_ran); |
| 133 | ms_sends_msg("055b"); |
| 134 | ASSERT_RELEASE_CLEAR(via_ran); |
Neels Hofmeyr | 4068ab2 | 2018-04-01 20:55:54 +0200 | [diff] [blame] | 135 | bss_rnc_sends_release_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 136 | |
| 137 | btw("LU was successful, and the conn has already been closed"); |
| 138 | EXPECT_CONN_COUNT(0); |
| 139 | |
| 140 | expected_use_count = 1; |
| 141 | |
| 142 | for (i = 0; i < loop_requests_without_hlr; i++, expected_use_count++) { |
| 143 | BTW("Now the auth tuple has use_count == %d", expected_use_count); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 144 | vsub = vlr_subscr_find_by_imsi(net->vlr, imsi, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 145 | OSMO_ASSERT(vsub); |
| 146 | OSMO_ASSERT(vsub->last_tuple); |
| 147 | VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 148 | vlr_subscr_put(vsub, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 149 | |
| 150 | BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," |
| 151 | " and reuses old auth vector"); |
| 152 | auth_request_sent = true; |
| 153 | cm_service_result_sent = RES_NONE; |
| 154 | ms_sends_msg("052478" |
| 155 | "03575886" /* classmark 2 */ |
| 156 | "089910070000106005" /* IMSI */); |
| 157 | OSMO_ASSERT(g_conn); |
Neels Hofmeyr | 4d3a66b | 2018-03-31 18:45:59 +0200 | [diff] [blame] | 158 | OSMO_ASSERT(g_conn->fi); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 159 | OSMO_ASSERT(g_conn->vsub); |
| 160 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 161 | VERBOSE_ASSERT(auth_request_sent, == true, "%d"); |
| 162 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 163 | if (via_ran == OSMO_RAT_GERAN_A) { |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 164 | btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); |
| 165 | gsup_expect_tx(NULL); |
| 166 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
| 167 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 168 | } else { |
| 169 | /* On UTRAN */ |
| 170 | btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 171 | expect_security_mode_ctrl(NULL, "27497388b6cb044648f396aa155b95ef"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 172 | ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 173 | VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 174 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 175 | |
| 176 | btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); |
| 177 | ms_sends_security_mode_complete(); |
| 178 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 179 | } |
| 180 | |
Vadim Yanitskiy | 2760585 | 2018-06-15 23:57:30 +0700 | [diff] [blame] | 181 | /* Release connection */ |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 182 | expect_release_clear(via_ran); |
Vadim Yanitskiy | 2760585 | 2018-06-15 23:57:30 +0700 | [diff] [blame] | 183 | conn_conclude_cm_service_req(g_conn, via_ran); |
Neels Hofmeyr | 4068ab2 | 2018-04-01 20:55:54 +0200 | [diff] [blame] | 184 | bss_rnc_sends_release_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 185 | |
| 186 | btw("all requests serviced, conn has been released"); |
| 187 | EXPECT_CONN_COUNT(0); |
| 188 | } |
| 189 | |
| 190 | if (final_request_with_hlr) { |
| 191 | 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] | 192 | vsub = vlr_subscr_find_by_imsi(net->vlr, imsi, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 193 | OSMO_ASSERT(vsub); |
| 194 | OSMO_ASSERT(vsub->last_tuple); |
| 195 | VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); |
Neels Hofmeyr | 7c5346c | 2019-02-19 02:36:35 +0100 | [diff] [blame] | 196 | vlr_subscr_put(vsub, __func__); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 197 | |
| 198 | BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," |
| 199 | " and needs to request a second auth vector from HLR"); |
| 200 | auth_request_sent = false; |
| 201 | cm_service_result_sent = RES_NONE; |
| 202 | gsup_expect_tx("080108" "09710000000156f0"); |
| 203 | ms_sends_msg("052478" |
| 204 | "03575886" /* classmark 2 */ |
| 205 | "089910070000106005" /* IMSI */); |
| 206 | OSMO_ASSERT(g_conn); |
Neels Hofmeyr | 4d3a66b | 2018-03-31 18:45:59 +0200 | [diff] [blame] | 207 | OSMO_ASSERT(g_conn->fi); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 208 | OSMO_ASSERT(g_conn->vsub); |
| 209 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 210 | VERBOSE_ASSERT(auth_request_sent, == false, "%d"); |
| 211 | VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); |
| 212 | |
| 213 | btw("from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS"); |
| 214 | auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d"; |
| 215 | auth_request_expect_autn = "1843a645b98d00005b2d666af46c45d9"; |
| 216 | gsup_rx("0a" |
| 217 | /* imsi */ |
| 218 | "0108" "09710000000156f0" |
| 219 | /* TL TL rand */ |
| 220 | /* TL sres TL kc */ |
| 221 | /* TL 3G IK */ |
| 222 | /* TL 3G CK */ |
| 223 | /* TL AUTN */ |
| 224 | /* TL RES */ |
| 225 | "0362" "2010" "c187a53a5e6b9d573cac7c74451fd46d" |
| 226 | "2104" "85aa3130" "2208" "d3d50a000bf04f6e" |
| 227 | "2310" "1159ec926a50e98c034a6b7d7c9f418d" |
| 228 | "2410" "df3a03d9ca5335641efc8e36d76cd20b" |
| 229 | "2510" "1843a645b98d00005b2d666af46c45d9" |
| 230 | "2708" "7db47cf7f81e4dc7", |
| 231 | NULL); |
| 232 | VERBOSE_ASSERT(auth_request_sent, == true, "%d"); |
| 233 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 234 | |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 235 | if (via_ran == OSMO_RAT_GERAN_A) { |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 236 | btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); |
| 237 | gsup_expect_tx(NULL); |
| 238 | ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ |
| 239 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 240 | } else { |
| 241 | /* On UTRAN */ |
| 242 | btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); |
Neels Hofmeyr | dbabfd3 | 2018-03-10 02:06:47 +0100 | [diff] [blame] | 243 | expect_security_mode_ctrl(NULL, "1159ec926a50e98c034a6b7d7c9f418d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 244 | 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] | 245 | VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 246 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 247 | |
| 248 | btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); |
| 249 | ms_sends_security_mode_complete(); |
| 250 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 251 | } |
| 252 | |
Vadim Yanitskiy | 2760585 | 2018-06-15 23:57:30 +0700 | [diff] [blame] | 253 | /* Release connection */ |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 254 | expect_release_clear(via_ran); |
Vadim Yanitskiy | 2760585 | 2018-06-15 23:57:30 +0700 | [diff] [blame] | 255 | conn_conclude_cm_service_req(g_conn, via_ran); |
Neels Hofmeyr | 4068ab2 | 2018-04-01 20:55:54 +0200 | [diff] [blame] | 256 | bss_rnc_sends_release_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 257 | |
| 258 | btw("all requests serviced, conn has been released"); |
| 259 | EXPECT_CONN_COUNT(0); |
| 260 | } |
| 261 | |
| 262 | BTW("subscriber detaches"); |
| 263 | expect_release_clear(via_ran); |
| 264 | ms_sends_msg("050130" |
| 265 | "089910070000106005" /* IMSI */); |
| 266 | ASSERT_RELEASE_CLEAR(via_ran); |
Neels Hofmeyr | 4068ab2 | 2018-04-01 20:55:54 +0200 | [diff] [blame] | 267 | bss_rnc_sends_release_clear_complete(via_ran); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 268 | |
| 269 | EXPECT_CONN_COUNT(0); |
| 270 | clear_vlr(); |
| 271 | } |
| 272 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 273 | static void test_auth_use_twice_geran() |
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_GERAN_A, 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_twice_utran() |
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_UTRAN_IU, 1, 1, true); |
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_geran() |
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_GERAN_A, -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_auth_use_infinitely_utran() |
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_UTRAN_IU, -1, 3, false); |
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_geran() |
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_GERAN_A, 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 | |
Neels Hofmeyr | f3d81f6 | 2018-03-02 01:05:38 +0100 | [diff] [blame] | 308 | static void test_no_auth_reuse_utran() |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 309 | { |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 310 | comment_start(); |
Neels Hofmeyr | 7814a83 | 2018-12-26 00:40:18 +0100 | [diff] [blame] | 311 | _test_auth_reuse(OSMO_RAT_UTRAN_IU, 0, 0, true); |
Neels Hofmeyr | dfdc61d | 2018-03-02 00:40:58 +0100 | [diff] [blame] | 312 | comment_end(); |
Neels Hofmeyr | 7b1418e | 2017-10-29 02:12:16 +0100 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | msc_vlr_test_func_t msc_vlr_tests[] = { |
| 316 | test_auth_use_twice_geran, |
| 317 | test_auth_use_twice_utran, |
| 318 | test_auth_use_infinitely_geran, |
| 319 | test_auth_use_infinitely_utran, |
| 320 | test_no_auth_reuse_geran, |
| 321 | test_no_auth_reuse_utran, |
| 322 | NULL |
| 323 | }; |