summaryrefslogtreecommitdiffstats
path: root/tests/gsup/gsup_test.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-08-16 12:22:29 +0200
committerlaforge <laforge@osmocom.org>2019-12-09 10:54:30 +0000
commit49ddef610a003f1000422284bf31a653249cf09e (patch)
treee1234acf31e43886976baa9f3ca643f406472f59 /tests/gsup/gsup_test.c
parent278a6c8fcfc04084cd459a990ad93077b2a9cab0 (diff)
gsup: Introduce OSMO_GSUP_NUM_VECTORS_REQ_IE
This is a bit of a hack, as we want to maintain binary compatibility without breaking existing users of libosmocore. To do so, we use the 'num_auth_vectors' field in two ways now: * In the existing use case as part of SEND_AUTH_INFO_RESPONSE, it indicates the number of vectors stored in the 'auth_vectors' field * In the new use case as part of SEND_AUTH_INFO_REQUEST, it indicates the number of vectors actually requested by the MSC/SGSN/MME. Change-Id: Iaecc47280f8ce54f3e3a888c1cfc160735483d0f
Diffstat (limited to 'tests/gsup/gsup_test.c')
-rw-r--r--tests/gsup/gsup_test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index b84c88f0..f34ac7a6 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -19,6 +19,7 @@
#define TEST_AN_APDU_IE 0x62, 0x05, 0x01, 0x42, 0x42, 0x42, 0x42
#define TEST_SOURCE_NAME_IE 0x60, 0x05, 'M', 'S', 'C', '-', 'A'
#define TEST_DESTINATION_NAME_IE 0x61, 0x05, 'M', 'S', 'C', '-', 'B'
+#define TEST_NUM_VEC_IE(x) 0x52, 1, x
static void test_gsup_messages_dec_enc(void)
{
@@ -32,6 +33,13 @@ static void test_gsup_messages_dec_enc(void)
TEST_CLASS_SUBSCR_IE
};
+ static const uint8_t send_auth_info_req10[] = {
+ 0x08,
+ TEST_IMSI_IE,
+ TEST_NUM_VEC_IE(10),
+ TEST_CLASS_SUBSCR_IE
+ };
+
static const uint8_t send_auth_info_err[] = {
0x09,
TEST_IMSI_IE,
@@ -612,6 +620,8 @@ static void test_gsup_messages_dec_enc(void)
send_e_abort, sizeof(send_e_abort)},
{"E Routing Error",
send_e_routing_error, sizeof(send_e_routing_error)},
+ {"Send Authentication Info Request (10 Vectors)",
+ send_auth_info_req10, sizeof(send_auth_info_req10)},
};
printf("Test GSUP message decoding/encoding\n");