From d405bad32db6d0af76be57d24e745ec5595bfda7 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 29 Nov 2021 00:58:02 +0300 Subject: [PATCH] libmsc: ran_iu_make_security_mode_command(): clarify UIA mask Change-Id: I7535d5ede5b22c61575a16d15927598e6137392a --- src/libmsc/ran_msg_iu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libmsc/ran_msg_iu.c b/src/libmsc/ran_msg_iu.c index 6705ab8be..cf57d350b 100644 --- a/src/libmsc/ran_msg_iu.c +++ b/src/libmsc/ran_msg_iu.c @@ -375,6 +375,8 @@ static struct msgb *ran_iu_make_rab_assignment(struct osmo_fsm_inst *caller_fi, static struct msgb *ran_iu_make_security_mode_command(struct osmo_fsm_inst *caller_fi, const struct ran_cipher_mode_command *cm) { + /* TODO: make the choice of available UIA algorithms configurable */ + const uint8_t uia_mask = (1 << OSMO_UTRAN_UIA1) | (1 << OSMO_UTRAN_UIA2); bool use_encryption = cm->utran.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0); LOG_RAN_IU_ENC(caller_fi, LOGL_DEBUG, "Tx RANAP SECURITY MODE COMMAND to RNC, IK=%s, CK=%s\n", @@ -384,7 +386,9 @@ static struct msgb *ran_iu_make_security_mode_command(struct osmo_fsm_inst *call * in the case of A5? */ return ranap_new_msg_sec_mod_cmd2(cm->vec->ik, use_encryption ? cm->vec->ck : NULL, - RANAP_KeyStatus_new, 0x06, cm->utran.uea_encryption_mask); + RANAP_KeyStatus_new, + (uia_mask << 1), /* API treats LSB as UIA0 */ + cm->utran.uea_encryption_mask); }