path: root/openbsc/tests
diff options
authorHarald Welte <laforge@gnumonks.org>2016-04-20 13:13:19 +0200
committerHarald Welte <laforge@gnumonks.org>2016-04-29 13:10:37 +0200
commit121e9a4164e65dfb68b2bf09297a8537a2f659c5 (patch)
tree19d0f18c0f0a093c30d1ba01af8532657d510657 /openbsc/tests
parent3ffce19cb4929c907460753d302e4720558cc6d2 (diff)
Start to use struct osmo_auth_vector from gsm_auth_tuple
Rather than having a 'private' structure for kc, sres and rand, we now finally (with 4 years delay) use osmo_auth_vector from libosmogsm, which encapsulates authentication vectors that can be either GSM triplets or UMTS quintuples or a combination of both. gsm_auth_tuple becomes a wrapper around osmo_auth_vector, adding use_count and key_seq to it. key_seq is no longer initialized inside gprs_gsup_messages.c, as there is no CKSN / key_seq inside the message anyway. If a usre of the code needs key_seq, they need to manage it themselves.
Diffstat (limited to 'openbsc/tests')
2 files changed, 4 insertions, 4 deletions
diff --git a/openbsc/tests/mm_auth/mm_auth_test.c b/openbsc/tests/mm_auth/mm_auth_test.c
index 34d96f187..b8777a8c5 100644
--- a/openbsc/tests/mm_auth/mm_auth_test.c
+++ b/openbsc/tests/mm_auth/mm_auth_test.c
@@ -26,9 +26,9 @@ static char *auth_tuple_str(struct gsm_auth_tuple *atuple)
print2buf("gsm_auth_tuple {\n");
print2buf(" .use_count = %d\n", atuple->use_count);
print2buf(" .key_seq = %d\n", atuple->key_seq);
- print2buf(" .rand = %s\n", osmo_hexdump(atuple->rand, sizeof(atuple->rand)));
- print2buf(" .sres = %s\n", osmo_hexdump(atuple->sres, sizeof(atuple->sres)));
- print2buf(" .kc = %s\n", osmo_hexdump(atuple->kc, sizeof(atuple->kc)));
+ print2buf(" .rand = %s\n", osmo_hexdump(atuple->vec.rand, sizeof(atuple->vec.rand)));
+ print2buf(" .sres = %s\n", osmo_hexdump(atuple->vec.sres, sizeof(atuple->vec.sres)));
+ print2buf(" .kc = %s\n", osmo_hexdump(atuple->vec.kc, sizeof(atuple->vec.kc)));
#undef print2buf
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 1acd6f2f8..fe41e759b 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -1132,7 +1132,7 @@ static void test_gmm_attach_subscr_fake_auth(void)
int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx)
struct gsm_auth_tuple at = {
- .sres = {0x51, 0xe5, 0x51, 0xe5},
+ .vec.sres = {0x51, 0xe5, 0x51, 0xe5},
.key_seq = 0