hnb-test: add Security Mode Command handling
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 @@
 {
 	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 @@
 
 		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;
 	}
 }