aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/hnb-test-ranap.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-19 00:06:28 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-19 01:32:25 +0200
commit4a0a69a88d90a403b2f6e62d9ee5badd1213d4d3 (patch)
tree1472445ae421a42bc490eeb40605d9ae1d36efc6 /src/tests/hnb-test-ranap.c
parenta9f5566482f164564fe639da434aa9e8d6dc12c0 (diff)
hnb-test: add Security Mode Command handling
Diffstat (limited to 'src/tests/hnb-test-ranap.c')
-rw-r--r--src/tests/hnb-test-ranap.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/hnb-test-ranap.c b/src/tests/hnb-test-ranap.c
index 63e3d92..4986e98 100644
--- a/src/tests/hnb-test-ranap.c
+++ b/src/tests/hnb-test-ranap.c
@@ -17,6 +17,8 @@ void hnb_test_rua_dt_handle_ranap(struct hnb_test *hnb,
{
int len;
char *data;
+ RANAP_PermittedIntegrityProtectionAlgorithms_t *algs;
+ RANAP_IntegrityProtectionAlgorithm_t *first_alg;
printf("rx ranap_msg->procedureCode %d\n",
ranap_msg->procedureCode);
@@ -32,5 +34,21 @@ void hnb_test_rua_dt_handle_ranap(struct hnb_test *hnb,
hnb_test_nas_rx_dtap(hnb, data, len);
return;
+
+ case RANAP_ProcedureCode_id_SecurityModeControl:
+ printf("rx SecurityModeControl: presence = %hx\n",
+ ranap_msg->msg.securityModeCommandIEs.presenceMask);
+
+ /* Just pick the first available IP alg, don't care about
+ * encryption (yet?) */
+ algs = &ranap_msg->msg.securityModeCommandIEs.integrityProtectionInformation.permittedAlgorithms;
+ if (algs->list.count < 1) {
+ printf("Security Mode Command: No permitted algorithms.\n");
+ return;
+ }
+ first_alg = *algs->list.array;
+
+ hnb_test_rx_secmode_cmd(hnb, *first_alg);
+ return;
}
}