Make UTRAN encryption algorithms configurable

Allow the user fine-grained control over which UMTS encryption
algorithms are permitted, rather than always permitting UEA1 and UEA2
or neither.

This brings the handling of UEA in line with the handling of A5 for
GERAN.

Change-Id: I91f9e50f9c1439aa19528f887b83ae9de628fcfd
Closes: OS#4144
Depends: osmo-iuh.git I6d2d033b0427bdc84fee61e0f3cb7b29935214bf
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 72e33a6..2a64c53 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -155,10 +155,8 @@
 	bool authentication_required;
 	int send_mm_info;
 
-	/* Whether to use encryption on UTRAN.
-	 * TODO: we should offer a choice of UEA1 and/or UEA2, and probably replace this bool with a bit-mask of
-	 * permitted Iu encryption algorithms. See also OS#4143 and the 'encryption uea' vty command. */
-	bool uea_encryption;
+	/* bit-mask of permitted encryption algorithms. LSB=UEA0, MSB=UEA7 */
+	uint8_t uea_encryption_mask;
 
 	struct rate_ctr_group *msc_ctrs;
 	struct osmo_stat_item_group *statg;
diff --git a/include/osmocom/msc/ran_msg.h b/include/osmocom/msc/ran_msg.h
index 816ef1f..0714607 100644
--- a/include/osmocom/msc/ran_msg.h
+++ b/include/osmocom/msc/ran_msg.h
@@ -103,7 +103,7 @@
 		struct geran_encr *chosen_key;
 	} geran;
 	struct {
-		bool uea_encryption;
+		uint8_t uea_encryption_mask;
 	} utran;
 };