aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-11-29 00:58:02 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-12-02 04:47:04 +0300
commitd405bad32db6d0af76be57d24e745ec5595bfda7 (patch)
tree176c7351172ed50aa0ccf45268a45c95072087ba
parent35db146e886463861d008a91b6ee25498e0b2eb4 (diff)
libmsc: ran_iu_make_security_mode_command(): clarify UIA mask
-rw-r--r--src/libmsc/ran_msg_iu.c6
1 files changed, 5 insertions, 1 deletions
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);
}