Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 1 | /* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
| 2 | * All Rights Reserved |
| 3 | * |
| 4 | * Author: Neels Hofmeyr <nhofmeyr@sysmocom.de> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Affero General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Affero General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <stdio.h> |
| 22 | #include <string.h> |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 23 | #include <inttypes.h> |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 24 | |
| 25 | #include <osmocom/core/application.h> |
| 26 | #include <osmocom/core/utils.h> |
| 27 | #include <osmocom/core/logging.h> |
| 28 | |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 29 | #include <osmocom/crypt/auth.h> |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 30 | |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 31 | #include "logging.h" |
| 32 | #include "auc.h" |
| 33 | |
| 34 | #define comment_start() fprintf(stderr, "\n===== %s\n", __func__); |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 35 | #define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); |
| 36 | |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 37 | #define VERBOSE_ASSERT(val, expect_op, fmt) \ |
| 38 | do { \ |
| 39 | fprintf(stderr, #val " == " fmt "\n", (val)); \ |
| 40 | OSMO_ASSERT((val) expect_op); \ |
| 41 | } while (0); |
| 42 | |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 43 | char *vec_str(const struct osmo_auth_vector *vec) |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 44 | { |
| 45 | static char buf[1024]; |
| 46 | char *pos = buf; |
| 47 | char *end = buf + sizeof(buf); |
| 48 | |
| 49 | #define append(what) \ |
| 50 | if (pos >= end) \ |
| 51 | return buf; \ |
| 52 | pos += snprintf(pos, sizeof(buf) - (pos - buf), \ |
| 53 | " " #what ": %s\n", \ |
| 54 | osmo_hexdump_nospc((void*)&vec->what, sizeof(vec->what))) |
| 55 | |
| 56 | append(rand); |
| 57 | append(autn); |
| 58 | append(ck); |
| 59 | append(ik); |
| 60 | append(res); |
| 61 | append(res_len); |
| 62 | append(kc); |
| 63 | append(sres); |
| 64 | append(auth_types); |
| 65 | #undef append |
| 66 | |
| 67 | return buf; |
| 68 | } |
| 69 | |
| 70 | #define VEC_IS(vec, expect) do { \ |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 71 | char *_is = vec_str(vec); \ |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 72 | fprintf(stderr, "auth vector ==\n%s\n", _is); \ |
| 73 | if (strcmp(_is, expect)) { \ |
| 74 | fprintf(stderr, "MISMATCH! expected ==\n%s\n", \ |
| 75 | expect); \ |
| 76 | char *a = _is; \ |
| 77 | char *b = expect; \ |
| 78 | for (; *a && *b; a++, b++) { \ |
| 79 | if (*a != *b) { \ |
| 80 | while (a > _is && *(a-1) != '\n') a--; \ |
| 81 | fprintf(stderr, "mismatch at %d:\n" \ |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 82 | "%s", (int)(a - _is), a); \ |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 83 | break; \ |
| 84 | } \ |
| 85 | } \ |
| 86 | OSMO_ASSERT(false); \ |
| 87 | } \ |
| 88 | } while (0) |
| 89 | |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 90 | uint8_t fake_rand[16] = { 0 }; |
| 91 | |
| 92 | int rand_get(uint8_t *rand, unsigned int len) |
| 93 | { |
| 94 | OSMO_ASSERT(len <= sizeof(fake_rand)); |
| 95 | memcpy(rand, fake_rand, len); |
| 96 | return len; |
| 97 | } |
| 98 | |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 99 | static void test_gen_vectors_2g_only(void) |
| 100 | { |
| 101 | struct osmo_sub_auth_data aud2g; |
| 102 | struct osmo_sub_auth_data aud3g; |
| 103 | struct osmo_auth_vector vec; |
| 104 | int rc; |
| 105 | |
| 106 | comment_start(); |
| 107 | |
| 108 | aud2g = (struct osmo_sub_auth_data){ |
| 109 | .type = OSMO_AUTH_TYPE_GSM, |
| 110 | .algo = OSMO_AUTH_ALG_COMP128v1, |
| 111 | }; |
| 112 | |
| 113 | osmo_hexparse("EB215756028D60E3275E613320AEC880", |
| 114 | aud2g.u.gsm.ki, sizeof(aud2g.u.gsm.ki)); |
| 115 | |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 116 | aud3g = (struct osmo_sub_auth_data){ 0 }; |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 117 | |
| 118 | osmo_hexparse("39fa2f4e3d523d8619a73b4f65c3e14d", |
| 119 | fake_rand, sizeof(fake_rand)); |
| 120 | |
| 121 | vec = (struct osmo_auth_vector){ {0} }; |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 122 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 123 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); |
| 124 | VERBOSE_ASSERT(rc, == 1, "%d"); |
| 125 | |
| 126 | VEC_IS(&vec, |
| 127 | " rand: 39fa2f4e3d523d8619a73b4f65c3e14d\n" |
| 128 | " autn: 00000000000000000000000000000000\n" |
| 129 | " ck: 00000000000000000000000000000000\n" |
| 130 | " ik: 00000000000000000000000000000000\n" |
| 131 | " res: 00000000000000000000000000000000\n" |
| 132 | " res_len: 00\n" |
| 133 | " kc: 241a5b16aeb8e400\n" |
| 134 | " sres: 429d5b27\n" |
| 135 | " auth_types: 01000000\n" |
| 136 | ); |
| 137 | |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 138 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 139 | |
| 140 | /* even though vec is not zero-initialized, it should produce the same |
| 141 | * result (regardless of the umts sequence nr) */ |
| 142 | aud3g.u.umts.sqn = 123; |
| 143 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); |
| 144 | VERBOSE_ASSERT(rc, == 1, "%d"); |
| 145 | |
| 146 | VEC_IS(&vec, |
| 147 | " rand: 39fa2f4e3d523d8619a73b4f65c3e14d\n" |
| 148 | " autn: 00000000000000000000000000000000\n" |
| 149 | " ck: 00000000000000000000000000000000\n" |
| 150 | " ik: 00000000000000000000000000000000\n" |
| 151 | " res: 00000000000000000000000000000000\n" |
| 152 | " res_len: 00\n" |
| 153 | " kc: 241a5b16aeb8e400\n" |
| 154 | " sres: 429d5b27\n" |
| 155 | " auth_types: 01000000\n" |
| 156 | ); |
| 157 | |
| 158 | comment_end(); |
| 159 | } |
| 160 | |
| 161 | static void test_gen_vectors_2g_plus_3g(void) |
| 162 | { |
| 163 | struct osmo_sub_auth_data aud2g; |
| 164 | struct osmo_sub_auth_data aud3g; |
| 165 | struct osmo_auth_vector vec; |
| 166 | int rc; |
| 167 | |
| 168 | comment_start(); |
| 169 | |
| 170 | aud2g = (struct osmo_sub_auth_data){ |
| 171 | .type = OSMO_AUTH_TYPE_GSM, |
| 172 | .algo = OSMO_AUTH_ALG_COMP128v1, |
| 173 | }; |
| 174 | |
| 175 | osmo_hexparse("EB215756028D60E3275E613320AEC880", |
| 176 | aud2g.u.gsm.ki, sizeof(aud2g.u.gsm.ki)); |
| 177 | |
| 178 | aud3g = (struct osmo_sub_auth_data){ |
| 179 | .type = OSMO_AUTH_TYPE_UMTS, |
| 180 | .algo = OSMO_AUTH_ALG_MILENAGE, |
| 181 | }; |
| 182 | |
| 183 | osmo_hexparse("EB215756028D60E3275E613320AEC880", |
| 184 | aud3g.u.umts.k, sizeof(aud3g.u.umts.k)); |
| 185 | osmo_hexparse("FB2A3D1B360F599ABAB99DB8669F8308", |
| 186 | aud3g.u.umts.opc, sizeof(aud3g.u.umts.opc)); |
| 187 | |
| 188 | osmo_hexparse("39fa2f4e3d523d8619a73b4f65c3e14d", |
| 189 | fake_rand, sizeof(fake_rand)); |
| 190 | |
| 191 | vec = (struct osmo_auth_vector){ {0} }; |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 192 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 193 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); |
| 194 | VERBOSE_ASSERT(rc, == 1, "%d"); |
| 195 | |
| 196 | VEC_IS(&vec, |
| 197 | " rand: 39fa2f4e3d523d8619a73b4f65c3e14d\n" |
| 198 | " autn: 8704f5ba55f30000d2ee44b22c8ea919\n" |
| 199 | " ck: f64735036e5871319c679f4742a75ea1\n" |
| 200 | " ik: 27497388b6cb044648f396aa155b95ef\n" |
| 201 | " res: e229c19e791f2e410000000000000000\n" |
| 202 | " res_len: 08\n" |
| 203 | " kc: 241a5b16aeb8e400\n" |
| 204 | " sres: 429d5b27\n" |
| 205 | " auth_types: 03000000\n" |
| 206 | ); |
| 207 | |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 208 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 1, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 209 | |
| 210 | /* even though vec is not zero-initialized, it should produce the same |
| 211 | * result with the same sequence nr */ |
| 212 | aud3g.u.umts.sqn = 0; |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 213 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 214 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); |
| 215 | VERBOSE_ASSERT(rc, == 1, "%d"); |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 216 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 1, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 217 | |
| 218 | VEC_IS(&vec, |
| 219 | " rand: 39fa2f4e3d523d8619a73b4f65c3e14d\n" |
| 220 | " autn: 8704f5ba55f30000d2ee44b22c8ea919\n" |
| 221 | " ck: f64735036e5871319c679f4742a75ea1\n" |
| 222 | " ik: 27497388b6cb044648f396aa155b95ef\n" |
| 223 | " res: e229c19e791f2e410000000000000000\n" |
| 224 | " res_len: 08\n" |
| 225 | " kc: 241a5b16aeb8e400\n" |
| 226 | " sres: 429d5b27\n" |
| 227 | " auth_types: 03000000\n" |
| 228 | ); |
| 229 | |
| 230 | comment_end(); |
| 231 | } |
| 232 | |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 233 | static void test_gen_vectors_3g_only(void) |
| 234 | { |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 235 | struct osmo_sub_auth_data aud2g; |
| 236 | struct osmo_sub_auth_data aud3g; |
| 237 | struct osmo_auth_vector vec; |
Neels Hofmeyr | ec9036b | 2017-02-21 21:56:11 +0100 | [diff] [blame^] | 238 | uint8_t auts[14]; |
| 239 | uint8_t rand_auts[16]; |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 240 | int rc; |
| 241 | |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 242 | comment_start(); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 243 | |
| 244 | aud2g = (struct osmo_sub_auth_data){ 0 }; |
| 245 | |
| 246 | aud3g = (struct osmo_sub_auth_data){ |
| 247 | .type = OSMO_AUTH_TYPE_UMTS, |
| 248 | .algo = OSMO_AUTH_ALG_MILENAGE, |
| 249 | }; |
| 250 | |
| 251 | osmo_hexparse("EB215756028D60E3275E613320AEC880", |
| 252 | aud3g.u.umts.k, sizeof(aud3g.u.umts.k)); |
| 253 | osmo_hexparse("FB2A3D1B360F599ABAB99DB8669F8308", |
| 254 | aud3g.u.umts.opc, sizeof(aud3g.u.umts.opc)); |
| 255 | |
| 256 | osmo_hexparse("39fa2f4e3d523d8619a73b4f65c3e14d", |
| 257 | fake_rand, sizeof(fake_rand)); |
| 258 | |
| 259 | vec = (struct osmo_auth_vector){ {0} }; |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 260 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 261 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); |
| 262 | VERBOSE_ASSERT(rc, == 1, "%d"); |
| 263 | |
| 264 | VEC_IS(&vec, |
| 265 | " rand: 39fa2f4e3d523d8619a73b4f65c3e14d\n" |
| 266 | " autn: 8704f5ba55f30000d2ee44b22c8ea919\n" |
| 267 | " ck: f64735036e5871319c679f4742a75ea1\n" |
| 268 | " ik: 27497388b6cb044648f396aa155b95ef\n" |
| 269 | " res: e229c19e791f2e410000000000000000\n" |
| 270 | " res_len: 08\n" |
| 271 | " kc: 059a4f668f6fbe39\n" |
| 272 | " sres: 9b36efdf\n" |
| 273 | " auth_types: 03000000\n" |
| 274 | ); |
| 275 | |
| 276 | /* Note: 3GPP TS 33.102 6.8.1.2: c3 function to get GSM auth is |
| 277 | * KC[0..7] == CK[0..7] ^ CK[8..15] ^ IK[0..7] ^ IK[8..15] |
| 278 | * In [16]: hex( 0xf64735036e587131 |
| 279 | * ^ 0x9c679f4742a75ea1 |
| 280 | * ^ 0x27497388b6cb0446 |
| 281 | * ^ 0x48f396aa155b95ef) |
| 282 | * Out[16]: '0x59a4f668f6fbe39L' |
| 283 | * hence expecting kc: 059a4f668f6fbe39 |
| 284 | */ |
| 285 | |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 286 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 1, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 287 | |
| 288 | /* even though vec is not zero-initialized, it should produce the same |
| 289 | * result with the same sequence nr */ |
| 290 | aud3g.u.umts.sqn = 0; |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 291 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 292 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, NULL, NULL); |
| 293 | VERBOSE_ASSERT(rc, == 1, "%d"); |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 294 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 1, "%"PRIu64); |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 295 | |
| 296 | VEC_IS(&vec, |
| 297 | " rand: 39fa2f4e3d523d8619a73b4f65c3e14d\n" |
| 298 | " autn: 8704f5ba55f30000d2ee44b22c8ea919\n" |
| 299 | " ck: f64735036e5871319c679f4742a75ea1\n" |
| 300 | " ik: 27497388b6cb044648f396aa155b95ef\n" |
| 301 | " res: e229c19e791f2e410000000000000000\n" |
| 302 | " res_len: 08\n" |
| 303 | " kc: 059a4f668f6fbe39\n" |
| 304 | " sres: 9b36efdf\n" |
| 305 | " auth_types: 03000000\n" |
| 306 | ); |
| 307 | |
Neels Hofmeyr | ec9036b | 2017-02-21 21:56:11 +0100 | [diff] [blame^] | 308 | |
| 309 | fprintf(stderr, "- test AUTS resync\n"); |
| 310 | vec = (struct osmo_auth_vector){}; |
| 311 | aud3g.u.umts.sqn = 0; |
| 312 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 0, "%"PRIu64); |
| 313 | |
| 314 | /* The AUTN sent was 8704f5ba55f30000d2ee44b22c8ea919 |
| 315 | * with the first 6 bytes being SQN ^ AK. |
| 316 | * K = EB215756028D60E3275E613320AEC880 |
| 317 | * OPC = FB2A3D1B360F599ABAB99DB8669F8308 |
| 318 | * RAND = 39fa2f4e3d523d8619a73b4f65c3e14d |
| 319 | * --milenage-f5--> |
| 320 | * AK = 8704f5ba55f3 |
| 321 | * |
| 322 | * The first six bytes are 8704f5ba55f3, |
| 323 | * and 8704f5ba55f3 ^ AK = 0. |
| 324 | * --> SQN = 0. |
| 325 | * |
| 326 | * Say the USIM doesn't like that, let's say it is at SQN 23. |
| 327 | * SQN_MS = 000000000017 |
| 328 | * |
| 329 | * AUTS = Conc(SQN_MS) || MAC-S |
| 330 | * Conc(SQN_MS) = SQN_MS ⊕ f5*[K](RAND) |
| 331 | * MAC-S = f1*[K] (SQN MS || RAND || AMF) |
| 332 | * |
| 333 | * f5*--> Conc(SQN_MS) = 000000000017 ^ 979498b1f73a |
| 334 | * = 979498b1f72d |
| 335 | * AMF = 0000 (TS 33.102 v7.0.0, 6.3.3) |
| 336 | * |
| 337 | * MAC-S = f1*[K] (000000000017 || 39fa2f4e3d523d8619a73b4f65c3e14d || 0000) |
| 338 | * = 3e28c59fa2e72f9c |
| 339 | * |
| 340 | * AUTS = 979498b1f72d || 3e28c59fa2e72f9c |
| 341 | * |
| 342 | * verify valid AUTS resulting in SQN 23 with: |
| 343 | * osmo-auc-gen -3 -a milenage -k EB215756028D60E3275E613320AEC880 \ |
| 344 | * -o FB2A3D1B360F599ABAB99DB8669F8308 \ |
| 345 | * -r 39fa2f4e3d523d8619a73b4f65c3e14d \ |
| 346 | * -A 979498b1f72d3e28c59fa2e72f9c |
| 347 | */ |
| 348 | |
| 349 | /* AUTS response by USIM */ |
| 350 | osmo_hexparse("979498b1f72d3e28c59fa2e72f9c", |
| 351 | auts, sizeof(auts)); |
| 352 | /* RAND sent to USIM, which AUTS was generated from */ |
| 353 | osmo_hexparse("39fa2f4e3d523d8619a73b4f65c3e14d", |
| 354 | rand_auts, sizeof(rand_auts)); |
| 355 | /* new RAND token for the next key */ |
| 356 | osmo_hexparse("897210a0f7de278f0b8213098e098a3f", |
| 357 | fake_rand, sizeof(fake_rand)); |
| 358 | rc = auc_compute_vectors(&vec, 1, &aud2g, &aud3g, rand_auts, auts); |
| 359 | VERBOSE_ASSERT(rc, == 1, "%d"); |
| 360 | /* The USIM's last sqn was 23, the calculated vector was 24, hence the |
| 361 | * next one stored should be 25. */ |
| 362 | VERBOSE_ASSERT(aud3g.u.umts.sqn, == 25, "%"PRIu64); |
| 363 | |
| 364 | VEC_IS(&vec, |
| 365 | " rand: 897210a0f7de278f0b8213098e098a3f\n" |
| 366 | " autn: c6b9790dad4b00000cf322869ea6a481\n" |
| 367 | " ck: e9922bd036718ed9e40bd1d02c3b81a5\n" |
| 368 | " ik: f19c20ca863137f8892326d959ec5e01\n" |
| 369 | " res: 9af5a557902d2db80000000000000000\n" |
| 370 | " res_len: 08\n" |
| 371 | " kc: 7526fc13c5976685\n" |
| 372 | " sres: 0ad888ef\n" |
| 373 | " auth_types: 03000000\n" |
| 374 | ); |
| 375 | |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 376 | comment_end(); |
| 377 | } |
| 378 | |
| 379 | int main() |
| 380 | { |
| 381 | printf("auc_3g_test.c\n"); |
| 382 | osmo_init_logging(&hlr_log_info); |
| 383 | log_set_print_filename(osmo_stderr_target, 0); |
| 384 | log_set_print_timestamp(osmo_stderr_target, 0); |
| 385 | log_set_use_color(osmo_stderr_target, 0); |
| 386 | log_set_print_category(osmo_stderr_target, 1); |
| 387 | |
Neels Hofmeyr | 8cde662 | 2017-01-31 02:10:40 +0100 | [diff] [blame] | 388 | test_gen_vectors_2g_only(); |
| 389 | test_gen_vectors_2g_plus_3g(); |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 390 | test_gen_vectors_3g_only(); |
| 391 | |
| 392 | printf("Done\n"); |
| 393 | return 0; |
| 394 | } |