msc: fix inter-msc ho tests: do not attempt to send "*"

Recently, encryption testing was added to the inter-MSC HO test. Instead
of sending the chosenEncryptionAlgorithm from the receive-template side
forward the actual received one (rx "*" usually means tx is "omit").

Change-Id: Icae084cfd63d666f3b0778fade7ba558bd161a0f
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index b12fb5e..5c63b63 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -5954,6 +5954,7 @@
 
 private function f_tc_ho_inter_msc_out(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var CallParameters cpars;
+	var PDU_BSSAP ho_request;
 
 	cpars := valueof(t_CallParams('12345'H, 0));
 	if (pars.use_ipv6) {
@@ -6015,13 +6016,18 @@
 	f_gsup_find_ie(prep_ho_req, OSMO_GSUP_SOURCE_NAME_IE, source_name_ie);
 	var octetstring local_msc_name := source_name_ie.source_name;
 
+	/* To forward the actual chosen encryption algorithm, decode the received PDU */
+	var GSUP_IeValue an_apdu_ie;
+	f_gsup_find_ie(prep_ho_req, OSMO_GSUP_AN_APDU_IE, an_apdu_ie);
+	ho_request := dec_PDU_BSSAP(an_apdu_ie.an_apdu.pdu);
+
 	/* Remote MSC has figured out its BSC and signals success */
 	var PDU_ML3_NW_MS rr_ho_cmd := valueof(ts_RR_HandoverCommand);
 	var octetstring rr_ho_cmd_enc := enc_PDU_ML3_NW_MS(rr_ho_cmd);
 	var PDU_BSSAP ho_req_ack := valueof(ts_BSSMAP_HandoverRequestAcknowledge(rr_ho_cmd_enc, lengthof(rr_ho_cmd_enc),
-					aoIPTransportLayer := omit,
-					speechCodec := ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}),
-					chosenEncryptionAlgorithm := chosenEncryptionAlgorithm));
+			aoIPTransportLayer := omit,
+			speechCodec := ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}),
+			chosenEncryptionAlgorithm := ho_request.pdu.bssmap.handoverRequest.chosenEncryptionAlgorithm));
 	GSUP.send(ts_GSUP_E_PrepareHandoverResult(
 				pars.imsi,
 				ho_number,
@@ -6159,9 +6165,8 @@
 	/* MSC asks local BSS to prepare Handover to it */
 	f_get_expected_encryption(encryptionInformation, chosenEncryptionAlgorithm, kC128, a5_perm_alg);
 	expect_ho_request := tr_BSSMAP_HandoverRequest(encryptionInformation, chosenEncryptionAlgorithm, kC128);
-	var PDU_BSSAP ho_request;
 	alt {
-	[] BSSAP.receive(expect_ho_request);
+	[] BSSAP.receive(expect_ho_request) -> value ho_request;
 	[] BSSAP.receive(tr_BSSMAP_HandoverRequest) -> value ho_request {
 		log("Error: Wrong handoverRequest received. Expected: ", expect_ho_request,
 		    " got ", ho_request);
@@ -6179,8 +6184,8 @@
 	var BSSMAP_IE_AoIP_TransportLayerAddress tla :=
 		valueof(f_ts_BSSMAP_IE_AoIP_TLA(cpars.bss_rtp_ip, cpars.bss_rtp_port));
 	BSSAP.send(ts_BSSMAP_HandoverRequestAcknowledge(rr_ho_cmd_enc, lengthof(rr_ho_cmd_enc),
-							tla, ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}),
-							chosenEncryptionAlgorithm := chosenEncryptionAlgorithm));
+			tla, ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}),
+			chosenEncryptionAlgorithm := ho_request.pdu.bssmap.handoverRequest.chosenEncryptionAlgorithm));
 
 	/* HandoverCommand goes out via remote MSC-I */
 	var GSUP_PDU prep_subsq_ho_res;